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.

◆ is_empty() [3/4]

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

Assumes that collection contains an item.

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.
xtd::tunit::abort_errorIf bad assertion.
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.