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

◆ is_not_instance_of_

#define is_not_instance_of_ (   type_t,
  ... 
)

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

Asserts that an object is not of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA facutative 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::invalid_argument except("invalid argument");
xtd::tunit::assert::is_not_instance_of_(std::bad_cast, except); // test ok.
xtd::tunit::assert::is_not_instance_of_(std::logic_error, except, "User message..."); // test error.
xtd::tunit::assume::is_not_instance_of_(std::bad_cast, except); // test ok.
xtd::tunit::assume::is_not_instance_of_(std::logic_error, except, "User message..."); // test error.
xtd::tunit::valid::is_not_instance_of_(std::bad_cast, except); // test ok.
xtd::tunit::valid::is_not_instance_of_(std::logic_error, except, "User message..."); // test error.