xtd 0.2.0
Loading...
Searching...
No Matches

◆ is_not_empty_

#define is_not_empty_ (   ...)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that collection does not contain any item.

Parameters
valueThe value to check is empty.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
xtd::tunit::assert::is_not_empty_(v1); // test ok.
xtd::tunit::assert::is_not_empty_(v2, "User message..."); // test error.
xtd::tunit::assume::is_not_empty_(v1); // test ok.
xtd::tunit::assume::is_not_empty_(v2, "User message..."); // test error.
xtd::tunit::valid::is_not_empty_(v1); // test ok.
xtd::tunit::valid::is_not_empty_(v2, "User message..."); // test error.