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

◆ is_null() [7/24]

template<typename optional_t >
static void xtd::tunit::valid::is_null ( const std::optional< optional_t > &  opt,
const xtd::string message 
)
inlinestatic

Validates that the optional is std::nullopt.

Parameters
optThe optional to check is std::nullopt.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Examples
xtd::uptr<std::string> s2 = "Anything";
xtd::tunit::valid::is_null(s1, "User message..."); // test ok.
xtd::tunit::valid::is_null(s2, "User message..."); // test fails.
static void is_null(const pointer_t *pointer)
Validates that the pointer is null.
Definition valid.h:1739
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.h:25