xtd.tunit - Reference Guide  1.0.0
Modern c++17 unit testing framework on Windows, macOS, Linux, iOS and android.
xtd::tunit::collection_assume Class Referencefinal

The collection_assume class contains a collection of static methods that implement the most collection assertions used in xtd::tUnit. More...

#include <collection_assume.h>

Inheritance diagram for xtd::tunit::collection_assume:
xtd::tunit::base_assert

Static Public Member Functions

template<typename TExpected , typename TCollection >
static void all_items_are_instances_of (const TCollection &collection)
 Assumes 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)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes 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)
 Assumes 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)
 Assumes that all collection items are not null. More...
 
template<typename TCollection >
static void all_items_are_not_null (const TCollection &collection, const xtd::tunit::line_info &line_info)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes that all collection items are not null. More...
 
template<typename TCollection >
static void all_items_are_unique (const TCollection &collection)
 Assumes that all collection items are unique. More...
 
template<typename TCollection >
static void all_items_are_unique (const TCollection &collection, const std::string &message)
 Assumes that all collection items are unique. More...
 
template<typename TCollection >
static void all_items_are_unique (const TCollection &collection, const xtd::tunit::line_info &line_info)
 Assumes that all collection items are unique. More...
 
template<typename TCollection >
static void all_items_are_unique (const TCollection &collection, const std::string &message, const xtd::tunit::line_info &line_info)
 Assumes that all collection items are unique. More...
 
template<typename TExpected , typename TAcutal >
static void are_equal (const TExpected &expected, const TAcutal &actual)
 Assumes 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)
 Assumes that all collection items are equal. More...
 
template<typename TExpected , typename TAcutal >
static void are_equal (const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes that all collection items are equal. More...
 
template<typename TExpected , typename TAcutal >
static void are_equivalent (const TExpected &expected, const TAcutal &actual)
 Assumes 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)
 Assumes that all collection items are equivalent. More...
 
template<typename TExpected , typename TAcutal >
static void are_equivalent (const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes that all collection items are equivalent. More...
 
template<typename TExpected , typename TAcutal >
static void are_not_equal (const TExpected &expected, const TAcutal &actual)
 Assumes 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)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes that all collection items arenot equal. More...
 
template<typename TExpected , typename TAcutal >
static void are_not_equivalent (const TExpected &expected, const TAcutal &actual)
 Assumes 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)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes that all collection items are not equivalent. More...
 
template<typename TExpected , typename TAcutal >
static void contains (const TExpected &expected, const TAcutal &actual)
 Assumes that ollection contains all items. More...
 
template<typename TExpected , typename TAcutal >
static void contains (const TExpected &expected, const TAcutal &actual, const std::string &message)
 Assumes that collection contains all items. More...
 
template<typename TExpected , typename TAcutal >
static void contains (const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes that collection contains all items. More...
 
template<typename TExpected , typename TAcutal >
static void does_not_contain (const TExpected &expected, const TAcutal &actual)
 Assumes 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)
 Assumes that collection contains all items. More...
 
template<typename TExpected , typename TAcutal >
static void does_not_contain (const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes that collection contains all items. More...
 
template<typename TValue >
static void is_empty (const TValue &value)
 Assumes that collection contains an item. More...
 
template<typename TValue >
static void is_empty (const TValue &value, const xtd::tunit::line_info &line_info)
 Assumes that collection contains an item. More...
 
template<typename TValue >
static void is_empty (const TValue &value, const std::string &message)
 Assumes that collection contains an item. More...
 
template<typename TValue >
static void is_empty (const TValue &value, const std::string &message, const xtd::tunit::line_info &line_info)
 Assumes that collection contains an item. More...
 
template<typename TValue >
static void is_not_empty (const TValue &value)
 Assumes that collection does not contain any item. More...
 
template<typename TValue >
static void is_not_empty (const TValue &value, const xtd::tunit::line_info &line_info)
 Assumes 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)
 Assumes 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 xtd::tunit::line_info &line_info)
 Assumes that collection or traits does not contain any item. More...
 
template<typename TValue >
static void is_ordered (const TValue &value)
 Assumes that collection is ordered. More...
 
template<typename TValue >
static void is_ordered (const TValue &value, const xtd::tunit::line_info &line_info)
 Assumes that collection is ordered. More...
 
template<typename TValue >
static void is_ordered (const TValue &value, const std::string &message)
 Assumes that collection is ordered. More...
 
template<typename TValue >
static void is_ordered (const TValue &value, const std::string &message, const xtd::tunit::line_info &line_info)
 Assumes that collection is ordered. More...
 

Static Private Member Functions

static void abort ()
 Abort current test. More...
 
static void abort (const xtd::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 xtd::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 xtd::tunit::line_info &line_info)
 
static void fail ()
 Throws an xtd::tunit::assertion_error exception. More...
 
static void fail (const xtd::tunit::line_info &line_info)
 Throws an xtd::tunit::assertion_error exception. More...
 
static void fail (const std::string &message)
 Throws an xtd::tunit::assertion_error exception. More...
 
static void fail (const std::string &message, const xtd::tunit::line_info &line_info)
 Throws an xtd::tunit::assertion_error exception. More...
 
static void fail (const std::string &actual, const std::string &expected, const std::string &message, const xtd::tunit::line_info &line_info)
 
static void ignore ()
 Ignore current test. More...
 
static void ignore (const xtd::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 xtd::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 xtd::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 xtd::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)
 

Detailed Description

The collection_assume class contains a collection of static methods that implement the most collection assertions used in xtd::tUnit.

Examples
This example show how to used some methods :

Member Function Documentation

§ all_items_are_instances_of() [1/4]

template<typename TExpected , typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_instances_of ( const TCollection &  collection)
inlinestatic

Assumes that all collection items are of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<std::ios_base*> a = {&std::cout, &std::cerr, &std::cin};
xtd::tunit::collection_assume::all_items_are_instances_of<std::ios_base*>(a); // test ok.
xtd::tunit::collection_assume::all_items_are_instances_of<std::basic_ostream<char>*>(a);// test throws an abort_error exception..

§ all_items_are_instances_of() [2/4]

template<typename TExpected , typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_instances_of ( const TCollection &  collection,
const std::string &  message 
)
inlinestatic

Assumes that all collection items are of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<std::ios_base*> a = {&std::cout, &std::cerr, &std::cin};
xtd::tunit::collection_assume::all_items_are_instances_of<std::ios_base*>(a, "User message..."); // test ok.
xtd::tunit::collection_assume::all_items_are_instances_of<std::basic_ostream<char>*>(a, "User message...");// test throws an abort_error exception..

§ all_items_are_instances_of() [3/4]

template<typename TExpected , typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_instances_of ( const TCollection &  collection,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<std::ios_base*> a = {&std::cout, &std::cerr, &std::cin};
xtd::tunit::collection_assume::all_items_are_instances_of<std::ios_base*>(a, line_info_); // test ok.
xtd::tunit::collection_assume::all_items_are_instances_of<std::basic_ostream<char>*>(a, line_info_);// test throws an abort_error exception..

§ all_items_are_instances_of() [4/4]

template<typename TExpected , typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_instances_of ( const TCollection &  collection,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<std::ios_base*> a = {&std::cout, &std::cerr, &std::cin};
xtd::tunit::collection_assume::all_items_are_instances_of<std::ios_base*>(a, "User message...", line_info_); // test ok.
xtd::tunit::collection_assume::all_items_are_instances_of<std::basic_ostream<char>*>(a, "User message...", line_info_);// test throws an abort_error exception..

§ all_items_are_not_null() [1/4]

template<typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_not_null ( const TCollection &  collection)
inlinestatic

Assumes that all collection items are not null.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
int i1 = 0, i2 = 3;
std::vector<int*> a1 = {&i1, &i2};
std::vector<int*> a2 = {&i1, &i2, nullptr};
xtd::tunit::collection_assume::all_items_are_not_null(a2);// test throws an abort_error exception..

§ all_items_are_not_null() [2/4]

template<typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_not_null ( const TCollection &  collection,
const std::string &  message 
)
inlinestatic

Assumes that all collection items are not null.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
int i1 = 0, i2 = 3;
std::vector<int*> a1 = {&i1, &i2};
xtd::tunit::collection_assume::all_items_are_not_null(a1, "User message..."); // test ok.
std::vector<int*> a2 = {&i1, &i2, nullptr};
xtd::tunit::collection_assume::all_items_are_not_null(a2, "User message...");// test throws an abort_error exception..

§ all_items_are_not_null() [3/4]

template<typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_not_null ( const TCollection &  collection,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are not null.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
int i1 = 0, i2 = 3;
std::vector<int*> a1 = {&i1, &i2};
std::vector<int*> a2 = {&i1, &i2, nullptr};
xtd::tunit::collection_assume::all_items_are_not_null(a2, line_info_);// test throws an abort_error exception..

§ all_items_are_not_null() [4/4]

template<typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_not_null ( const TCollection &  collection,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are not null.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
int i1 = 0, i2 = 3;
std::vector<int*> a1 = {&i1, &i2};
std::vector<int*> a2 = {&i1, &i2, nullptr};
xtd::tunit::collection_assume::all_items_are_not_null(a2, "User message...", line_info_);// test throws an abort_error exception..

§ all_items_are_unique() [1/4]

template<typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_unique ( const TCollection &  collection)
inlinestatic

Assumes that all collection items are unique.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a1 = {1, 2, 3, 4};
std::vector<int> a2 = {1, 2, 3, 4, 1};
xtd::tunit::collection_assume::all_items_are_unique(a2);// test throws an abort_error exception..

§ all_items_are_unique() [2/4]

template<typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_unique ( const TCollection &  collection,
const std::string &  message 
)
inlinestatic

Assumes that all collection items are unique.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a1 = {1, 2, 3, 4};
xtd::tunit::collection_assume::all_items_are_unique(a1, "User message..."); // test ok.
std::vector<int> a2 = {1, 2, 3, 4, 1};
xtd::tunit::collection_assume::all_items_are_unique(a2, "User message...");// test throws an abort_error exception..

§ all_items_are_unique() [3/4]

template<typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_unique ( const TCollection &  collection,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are unique.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a1 = {1, 2, 3, 4};
xtd::tunit::collection_assume::all_iall_items_are_uniquetems_are_not_null(a1, line_info_); // test ok.
std::vector<int> a2 = {1, 2, 3, 4, 1};
xtd::tunit::collection_assume::all_items_are_unique(a2, line_info_);// test throws an abort_error exception..

§ all_items_are_unique() [4/4]

template<typename TCollection >
static void xtd::tunit::collection_assume::all_items_are_unique ( const TCollection &  collection,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are unique.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a1 = {1, 2, 3, 4};
std::vector<int> a2 = {1, 2, 3, 4, 1};
xtd::tunit::collection_assume::all_items_are_unique(a2, "User message...", line_info_);// test throws an abort_error exception..

§ are_equal() [1/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_equal ( const TExpected &  expected,
const TAcutal &  actual 
)
inlinestatic

Assumes that all collection items are equal.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_equal({1, 2, 3, 4}, a); // test ok.
xtd::tunit::collection_assume::are_equal({4, 3, 2, 1}, a);// test throws an abort_error exception..

§ are_equal() [2/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_equal ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message 
)
inlinestatic

Assumes that all collection items are equal.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_equal({1, 2, 3, 4}, a, "User message..."); // test ok.
xtd::tunit::collection_assume::are_equal({4, 3, 2, 1}, a, "User message...");// test throws an abort_error exception..

§ are_equal() [3/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_equal ( const TExpected &  expected,
const TAcutal &  actual,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are equal.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_equal({4, 3, 2, 1}, a, line_info_);// test throws an abort_error exception..

§ are_equal() [4/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_equal ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are equal.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_equal({1, 2, 3, 4}, a, "User message...", line_info_); // test ok.
xtd::tunit::collection_assume::are_equal({4, 3, 2, 1}, a, "User message...", line_info_);// test throws an abort_error exception..

§ are_equivalent() [1/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_equivalent ( const TExpected &  expected,
const TAcutal &  actual 
)
inlinestatic

Assumes that all collection items are equivalent.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_equivalent({4, 3, 2, 1}, a); // test ok.
xtd::tunit::collection_assume::are_equivalent({1, 2, 3, 5}, a);// test throws an abort_error exception..

§ are_equivalent() [2/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_equivalent ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message 
)
inlinestatic

Assumes that all collection items are equivalent.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_equivalent({4, 3, 2, 1}, a, "User message..."); // test ok.
xtd::tunit::collection_assume::are_equivalent({1, 2, 3, 5}, a, "User message...");// test throws an abort_error exception..

§ are_equivalent() [3/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_equivalent ( const TExpected &  expected,
const TAcutal &  actual,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are equivalent.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_equivalent({1, 2, 3, 5}, a, line_info_);// test throws an abort_error exception..

§ are_equivalent() [4/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_equivalent ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are equivalent.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_equivalent({4, 3, 2, 1}, a, "User message...", line_info_); // test ok.
xtd::tunit::collection_assume::are_equivalent({1, 2, 3, 5}, a, "User message...", line_info_);// test throws an abort_error exception..

§ are_not_equal() [1/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_not_equal ( const TExpected &  expected,
const TAcutal &  actual 
)
inlinestatic

Assumes that all collection items are not equal.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_not_equal({4, 3, 2, 1}, a); // test ok.
xtd::tunit::collection_assume::are_not_equal({1, 2, 3, 4}, a);// test throws an abort_error exception..

§ are_not_equal() [2/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_not_equal ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message 
)
inlinestatic

Assumes that all collection items are not equal.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_not_equal({4, 3, 2, 1}, a, "User message..."); // test ok.
xtd::tunit::collection_assume::are_not_equal({1, 2, 3, 4}, a, "User message...");// test throws an abort_error exception..

§ are_not_equal() [3/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_not_equal ( const TExpected &  expected,
const TAcutal &  actual,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are not equal.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_not_equal({1, 2, 3, 4}, a, line_info_);// test throws an abort_error exception..

§ are_not_equal() [4/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_not_equal ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items arenot equal.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_not_equal({4, 3, 2, 1}, a, "User message...", line_info_); // test ok.
xtd::tunit::collection_assume::are_not_equal({1, 2, 3, 4}, a, "User message...", line_info_);// test throws an abort_error exception..

§ are_not_equivalent() [1/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_not_equivalent ( const TExpected &  expected,
const TAcutal &  actual 
)
inlinestatic

Assumes that all collection items are not equivalent.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_not_equivalent({4, 3, 2, 1}, a);// test throws an abort_error exception..

§ are_not_equivalent() [2/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_not_equivalent ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message 
)
inlinestatic

Assumes that all collection items are not equivalent.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_not_equivalent({1, 2, 3, 5}, a, "User message..."); // test ok.
xtd::tunit::collection_assume::are_not_equivalent({4, 3, 2, 1}, a, "User message...");// test throws an abort_error exception..

§ are_not_equivalent() [3/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_not_equivalent ( const TExpected &  expected,
const TAcutal &  actual,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are not equivalent.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_not_equivalent({4, 3, 2, 1}, a, line_info_);// test throws an abort_error exception..

§ are_not_equivalent() [4/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::are_not_equivalent ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that all collection items are not equivalent.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::are_not_equivalent({1, 2, 3, 5}, a, "User message...", line_info_); // test ok.
xtd::tunit::collection_assume::are_not_equivalent({4, 3, 2, 1}, a, "User message...", line_info_);// test throws an abort_error exception..

§ contains() [1/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::contains ( const TExpected &  expected,
const TAcutal &  actual 
)
inlinestatic

Assumes that ollection contains all items.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::contains({1, 2, 6}, a);// test throws an abort_error exception..

§ contains() [2/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::contains ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message 
)
inlinestatic

Assumes that collection contains all items.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::contains({1, 2}, a, "User message..."); // test ok.
xtd::tunit::collection_assume::contains({1, 2, 6}, a, "User message...");// test throws an abort_error exception..

§ contains() [3/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::contains ( const TExpected &  expected,
const TAcutal &  actual,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains all items.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::contains({1, 2, 6}, a, line_info_);// test throws an abort_error exception..

§ contains() [4/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::contains ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains all items.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::contains({1, 2}, a, "User message...", line_info_); // test ok.
xtd::tunit::collection_assume::contains({1, 2, 6}, a, "User message...", line_info_);// test throws an abort_error exception..

§ does_not_contain() [1/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::does_not_contain ( const TExpected &  expected,
const TAcutal &  actual 
)
inlinestatic

Assumes that ollection contains all items.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::does_not_contain({1, 2, 6}, a);// test throws an abort_error exception..

§ does_not_contain() [2/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::does_not_contain ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message 
)
inlinestatic

Assumes that collection contains all items.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::does_not_contain({1, 2}, a, "User message..."); // test ok.
xtd::tunit::collection_assume::does_not_contain({1, 2, 6}, a, "User message...");// test throws an abort_error exception..

§ does_not_contain() [3/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::does_not_contain ( const TExpected &  expected,
const TAcutal &  actual,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains all items.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::does_not_contain({1, 2, 6}, a, line_info_);// test throws an abort_error exception..

§ does_not_contain() [4/4]

template<typename TExpected , typename TAcutal >
static void xtd::tunit::collection_assume::does_not_contain ( const TExpected &  expected,
const TAcutal &  actual,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains all items.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assume::does_not_contain({1, 2}, a, "User message...", line_info_); // test ok.
xtd::tunit::collection_assume::does_not_contain({1, 2, 6}, a, "User message...", line_info_);// test throws an abort_error exception..

§ is_empty() [1/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_empty ( const TValue &  value)
inlinestatic

Assumes that collection contains an item.

Parameters
valueThe value to check is empty.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
xtd::tunit::assert::is_empty(v2);// test throws an abort_error exception.

§ is_empty() [2/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_empty ( const TValue &  value,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains an item.

Parameters
valueThe value to check is empty.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
xtd::tunit::assert::is_empty(v2, line_info_);// test throws an abort_error exception.

§ is_empty() [3/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_empty ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that collection contains an item.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
xtd::tunit::assert::is_empty(v1, "User message..."); // test ok.
xtd::tunit::assert::is_empty(v2, "User message...");// test throws an abort_error exception.

§ is_empty() [4/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_empty ( const TValue &  value,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains an item.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
xtd::tunit::assert::is_empty(v1, "User message...", line_info_); // test ok.
xtd::tunit::assert::is_empty(v2, "User message...", line_info_);// test throws an abort_error exception.

§ is_not_empty() [1/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_not_empty ( const TValue &  value)
inlinestatic

Assumes that collection does not contain any item.

Parameters
valueThe value to check is empty.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
xtd::tunit::assert::is_not_empty(v2);// test throws an abort_error exception.

§ is_not_empty() [2/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_not_empty ( const TValue &  value,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection or traits does not contain any item.

Parameters
valueThe value to check is empty.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
xtd::tunit::assert::is_not_empty(v2, line_info_);// test throws an abort_error exception.

§ is_not_empty() [3/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_not_empty ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that collection or traits does not contain any item.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
xtd::tunit::assert::is_not_empty(v1, "User message..."); // test ok.
xtd::tunit::assert::is_not_empty(v2, "User message...");// test throws an abort_error exception.

§ is_not_empty() [4/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_not_empty ( const TValue &  value,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection or traits does not contain any item.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
xtd::tunit::assert::is_not_empty(v1, "User message...", line_info_); // test ok.
xtd::tunit::assert::is_not_empty(v2, "User message...", line_info_);// test throws an abort_error exception.

§ is_ordered() [1/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_ordered ( const TValue &  value)
inlinestatic

Assumes that collection is ordered.

Parameters
valueThe value to check is empty.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
std::vector<int> v2 = {1, 2, 4, 3};
xtd::tunit::assert::is_ordered(v1); // test ok.
xtd::tunit::assert::is_ordered(v2);// test throws an abort_error exception.

§ is_ordered() [2/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_ordered ( const TValue &  value,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection is ordered.

Parameters
valueThe value to check is empty.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
std::vector<int> v2 = {1, 2, 4, 3};
xtd::tunit::assert::is_ordered(v1, line_info_); // test ok.
xtd::tunit::assert::is_ordered(v2, line_info_);// test throws an abort_error exception.

§ is_ordered() [3/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_ordered ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that collection is ordered.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
std::vector<int> v2 = {1, 2, 4, 3};
xtd::tunit::assert::is_ordered(v1, "User message..."); // test ok.
xtd::tunit::assert::is_ordered(v2, "User message...");// test throws an abort_error exception.

§ is_ordered() [4/4]

template<typename TValue >
static void xtd::tunit::collection_assume::is_ordered ( const TValue &  value,
const std::string &  message,
const xtd::tunit::line_info line_info 
)
inlinestatic

Assumes that collection is ordered.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
std::vector<int> v2 = {1, 2, 4, 3};
xtd::tunit::assert::is_ordered(v1, "User message...", line_info_); // test ok.
xtd::tunit::assert::is_ordered(v2, "User message...", line_info_);// test throws an abort_error exception.

The documentation for this class was generated from the following file: