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

◆ throws_any() [3/4]

static void xtd::tunit::valid::throws_any ( const std::function< void()> &  statement,
const xtd::string message 
)
static

Validates that the statement does not throw an exception.

Parameters
statementThe statement that verify.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
xtd::tunit::valid::throws_any([&] {v1.at(5);}, "User message..."); // test ok.
xtd::tunit::valid::throws_any([&] {v1.at(2);}, "User message..."); // test fails.
static void throws_any(const std::function< void()> &statement)
Validates that the statement does not throw an exception.