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

◆ contains_

#define contains_ (   ...)

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

Asserts that collection contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
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};
xtd::tunit::assert::contains_(2, v1); // test ok.
xtd::tunit::assert::contains_(4, v1, "User message..."); // test error.
xtd::tunit::assume::contains_(2, v1); // test ok.
xtd::tunit::assume::contains_(4, v1, "User message..."); // test error.
xtd::tunit::valid::contains_(2, v1); // test ok.
xtd::tunit::valid::contains_(4, v1, "User message..."); // test error.