xtd 0.2.0

◆ all_items_are_not_null_

#define all_items_are_not_null_ (   ...)

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

Asserts that all collection items are not null.

Parameters
valueThe object to verify
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::collection_assert, xtd::tunit::collection_assume and xtd::tunit::collection_valid classes.
Examples
int i1 = 0, i2 = 3;
std::vector<int*> a1 = {&i1, &i2};
std::vector<int*> a2 = {&i1, &i2, nullptr};
xtd::tunit::collection_assert::all_items_are_not_null_(a1); // test ok.
xtd::tunit::collection_assert::all_items_are_not_null_(a2, "User message..."); // test error.
xtd::tunit::collection_assume::all_items_are_not_null_(a1); // test ok.
xtd::tunit::collection_assume::all_items_are_not_null_(a2, "User message..."); // test error.
xtd::tunit::collection_valid::all_items_are_not_null_(a1); // test ok.
xtd::tunit::collection_valid::all_items_are_not_null_(a2, "User message..."); // test error.