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

◆ does_not_throw() [1/4]

static void xtd::tunit::valid::does_not_throw ( const std::function< void()> &  statement)
static

Validates that the statement does not throw an exception.

Parameters
statementThe statement that verify.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
xtd::tunit::valid::does_not_throw([&] {v1.at(2);}); // test ok.
xtd::tunit::valid::does_not_throw([&] {v1.at(5);}); // test fails.
static void does_not_throw(const std::function< void()> &statement)
Validates that the statement does not throw an exception.