xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.

◆ 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..