![]() |
tunit - Reference Guide
1.0.0
Modern c++17 unit testing framework on Windows, macOS, Linux, iOS and android.
|
The collection_valid class contains a collection of static methods that implement the most collection assertions used in tUnit. More...
#include <collection_valid.h>
Static Public Member Functions | |
template<typename TExpected , typename TCollection > | |
static void | all_items_are_instances_of (const TCollection &collection) |
Valids that all collection items are of the type supplied or a derived type. More... | |
template<typename TExpected , typename TCollection > | |
static void | all_items_are_instances_of (const TCollection &collection, const std::string &message) |
Valids that all collection items are of the type supplied or a derived type. More... | |
template<typename TExpected , typename TCollection > | |
static void | all_items_are_instances_of (const TCollection &collection, const tunit::line_info &line_info) |
Valids that all collection items are of the type supplied or a derived type. More... | |
template<typename TExpected , typename TCollection > | |
static void | all_items_are_instances_of (const TCollection &collection, const std::string &message, const tunit::line_info &line_info) |
Valids that all collection items are of the type supplied or a derived type. More... | |
template<typename TCollection > | |
static void | all_items_are_not_null (const TCollection &collection) |
Valids that all collection items are not null. More... | |
template<typename TCollection > | |
static void | all_items_are_not_null (const TCollection &collection, const std::string &message) |
Valids that all collection items are not null. More... | |
template<typename TCollection > | |
static void | all_items_are_not_null (const TCollection &collection, const tunit::line_info &line_info) |
Valids that all collection items are not null. More... | |
template<typename TCollection > | |
static void | all_items_are_not_null (const TCollection &collection, const std::string &message, const tunit::line_info &line_info) |
Valids that all collection items are not null. More... | |
template<typename TCollection > | |
static void | all_items_are_unique (const TCollection &collection) |
Valids that all collection items are unique. More... | |
template<typename TCollection > | |
static void | all_items_are_unique (const TCollection &collection, const std::string &message) |
Valids that all collection items are unique. More... | |
template<typename TCollection > | |
static void | all_items_are_unique (const TCollection &collection, const tunit::line_info &line_info) |
Valids that all collection items are unique. More... | |
template<typename TCollection > | |
static void | all_items_are_unique (const TCollection &collection, const std::string &message, const tunit::line_info &line_info) |
Valids that all collection items are unique. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_equal (const TExpected &expected, const TAcutal &actual) |
Valids that all collection items are equal. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_equal (const TExpected &expected, const TAcutal &actual, const std::string &message) |
Valids that all collection items are equal. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_equal (const TExpected &expected, const TAcutal &actual, const tunit::line_info &line_info) |
Valids that all collection items are equal. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_equal (const TExpected &expected, const TAcutal &actual, const std::string &message, const tunit::line_info &line_info) |
Valids that all collection items are equal. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_equivalent (const TExpected &expected, const TAcutal &actual) |
Valids that all collection items are equivalent. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_equivalent (const TExpected &expected, const TAcutal &actual, const std::string &message) |
Valids that all collection items are equivalent. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_equivalent (const TExpected &expected, const TAcutal &actual, const tunit::line_info &line_info) |
Valids that all collection items are equivalent. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_equivalent (const TExpected &expected, const TAcutal &actual, const std::string &message, const tunit::line_info &line_info) |
Valids that all collection items are equivalent. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_not_equal (const TExpected &expected, const TAcutal &actual) |
Valids that all collection items are not equal. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_not_equal (const TExpected &expected, const TAcutal &actual, const std::string &message) |
Valids that all collection items are not equal. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_not_equal (const TExpected &expected, const TAcutal &actual, const tunit::line_info &line_info) |
Valids that all collection items are not equal. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_not_equal (const TExpected &expected, const TAcutal &actual, const std::string &message, const tunit::line_info &line_info) |
Valids that all collection items arenot equal. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_not_equivalent (const TExpected &expected, const TAcutal &actual) |
Valids that all collection items are not equivalent. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_not_equivalent (const TExpected &expected, const TAcutal &actual, const std::string &message) |
Valids that all collection items are not equivalent. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_not_equivalent (const TExpected &expected, const TAcutal &actual, const tunit::line_info &line_info) |
Valids that all collection items are not equivalent. More... | |
template<typename TExpected , typename TAcutal > | |
static void | are_not_equivalent (const TExpected &expected, const TAcutal &actual, const std::string &message, const tunit::line_info &line_info) |
Valids that all collection items are not equivalent. More... | |
template<typename TExpected , typename TAcutal > | |
static void | contains (const TExpected &expected, const TAcutal &actual) |
Valids that ollection contains all items. More... | |
template<typename TExpected , typename TAcutal > | |
static void | contains (const TExpected &expected, const TAcutal &actual, const std::string &message) |
Valids that collection contains all items. More... | |
template<typename TExpected , typename TAcutal > | |
static void | contains (const TExpected &expected, const TAcutal &actual, const tunit::line_info &line_info) |
Valids that collection contains all items. More... | |
template<typename TExpected , typename TAcutal > | |
static void | contains (const TExpected &expected, const TAcutal &actual, const std::string &message, const tunit::line_info &line_info) |
Valids that collection contains all items. More... | |
template<typename TExpected , typename TAcutal > | |
static void | does_not_contain (const TExpected &expected, const TAcutal &actual) |
Valids that ollection contains all items. More... | |
template<typename TExpected , typename TAcutal > | |
static void | does_not_contain (const TExpected &expected, const TAcutal &actual, const std::string &message) |
Valids that collection contains all items. More... | |
template<typename TExpected , typename TAcutal > | |
static void | does_not_contain (const TExpected &expected, const TAcutal &actual, const tunit::line_info &line_info) |
Valids that collection contains all items. More... | |
template<typename TExpected , typename TAcutal > | |
static void | does_not_contain (const TExpected &expected, const TAcutal &actual, const std::string &message, const tunit::line_info &line_info) |
Valids that collection contains all items. More... | |
template<typename TValue > | |
static void | is_empty (const TValue &value) |
Valids that collection contains an item. More... | |
template<typename TValue > | |
static void | is_empty (const TValue &value, const tunit::line_info &line_info) |
Valids that collection contains an item. More... | |
template<typename TValue > | |
static void | is_empty (const TValue &value, const std::string &message) |
Valids that collection contains an item. More... | |
template<typename TValue > | |
static void | is_empty (const TValue &value, const std::string &message, const tunit::line_info &line_info) |
Valids that collection contains an item. More... | |
template<typename TValue > | |
static void | is_not_empty (const TValue &value) |
Valids that collection does not contain any item. More... | |
template<typename TValue > | |
static void | is_not_empty (const TValue &value, const tunit::line_info &line_info) |
Valids that collection or traits does not contain any item. More... | |
template<typename TValue > | |
static void | is_not_empty (const TValue &value, const std::string &message) |
Valids that collection or traits does not contain any item. More... | |
template<typename TValue > | |
static void | is_not_empty (const TValue &value, const std::string &message, const tunit::line_info &line_info) |
Valids that collection or traits does not contain any item. More... | |
template<typename TValue > | |
static void | is_ordered (const TValue &value) |
Valids that collection is ordered. More... | |
template<typename TValue > | |
static void | is_ordered (const TValue &value, const tunit::line_info &line_info) |
Valids that collection is ordered. More... | |
template<typename TValue > | |
static void | is_ordered (const TValue &value, const std::string &message) |
Valids that collection is ordered. More... | |
template<typename TValue > | |
static void | is_ordered (const TValue &value, const std::string &message, const tunit::line_info &line_info) |
Valids that collection is ordered. More... | |
Static Private Member Functions | |
static void | abort () |
Abort current test. More... | |
static void | abort (const tunit::line_info &line_info) |
Abort current test. More... | |
static void | abort (const std::string &message) |
Abort current test. More... | |
static void | abort (const std::string &message, const tunit::line_info &line_info) |
Abort current test. More... | |
static void | error () |
static void | error (const std::string &actual, const std::string &expected, const std::string &message, const tunit::line_info &line_info) |
static void | fail () |
Throws an tunit::assertion_error exception. More... | |
static void | fail (const tunit::line_info &line_info) |
Throws an tunit::assertion_error exception. More... | |
static void | fail (const std::string &message) |
Throws an tunit::assertion_error exception. More... | |
static void | fail (const std::string &message, const tunit::line_info &line_info) |
Throws an tunit::assertion_error exception. More... | |
static void | fail (const std::string &actual, const std::string &expected, const std::string &message, const tunit::line_info &line_info) |
static void | ignore () |
Ignore current test. More... | |
static void | ignore (const tunit::line_info &line_info) |
Ignore current test. More... | |
static void | ignore (const std::string &message) |
Ignore current test. More... | |
static void | ignore (const std::string &message, const tunit::line_info &line_info) |
Ignore current test. More... | |
template<typename TCollection > | |
static std::string | join_items (const TCollection &collection) |
static std::string | join_items (const std::string &str) |
static void | succeed () |
Generates a success with a generic message. More... | |
static void | succeed (const tunit::line_info &line_info) |
Generates a success with a generic message. More... | |
static void | succeed (const std::string &message) |
Generates a success with a generic message. More... | |
static void | succeed (const std::string &message, const tunit::line_info &line_info) |
Generates a success with a generic message. More... | |
template<typename TValue > | |
static std::string | to_string (const TValue &value) |
template<typename TValue > | |
static std::string | to_string (const TValue *value) |
The collection_valid class contains a collection of static methods that implement the most collection assertions used in tUnit.
|
inlinestatic |
Valids that all collection items are of the type supplied or a derived type.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are of the type supplied or a derived type.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are of the type supplied or a derived type.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are of the type supplied or a derived type.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not null.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not null.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not null.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not null.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are unique.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are unique.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are unique.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are unique.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are equal.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are equal.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are equal.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are equal.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are equivalent.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are equivalent.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are equivalent.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are equivalent.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not equal.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not equal.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not equal.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items arenot equal.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not equivalent.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not equivalent.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not equivalent.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that all collection items are not equivalent.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that ollection contains all items.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection contains all items.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection contains all items.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection contains all items.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that ollection contains all items.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection contains all items.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection contains all items.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection contains all items.
value | The object to verify |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection contains an item.
value | The value to check is empty. |
|
inlinestatic |
Valids that collection contains an item.
value | The value to check is empty. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection contains an item.
value | The value to check is empty. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
|
inlinestatic |
Valids that collection contains an item.
value | The value to check is empty. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection does not contain any item.
value | The value to check is empty. |
|
inlinestatic |
Valids that collection or traits does not contain any item.
value | The value to check is empty. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection or traits does not contain any item.
value | The value to check is empty. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
|
inlinestatic |
Valids that collection or traits does not contain any item.
value | The value to check is empty. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection is ordered.
value | The value to check is empty. |
|
inlinestatic |
Valids that collection is ordered.
value | The value to check is empty. |
line_info | Contains information about current file and current line. |
|
inlinestatic |
Valids that collection is ordered.
value | The value to check is empty. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
|
inlinestatic |
Valids that collection is ordered.
value | The value to check is empty. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
line_info | Contains information about current file and current line. |