#include <xtd/xtd.tunit>
#include <algorithm>
public:
template<typename TValue1, typename TValue2>
template<typename TValue1, typename TValue2>
template<typename TValue1, typename TValue2>
static void is_max(TValue1 value1, TValue2 value2,
const std::string& message) {is_max(value1, value2, message,
xtd::diagnostics::stack_frame());}
template<typename TValue1, typename TValue2>
try {
if (std::max(value1, value2) == value1)
else
base_assert::fail(
"greater of " + base_assert::to_string(value2), base_assert::to_string(value1), message, stack_frame);
} catch (...) {
}
}
template<typename TValue1, typename TValue2>
template<typename TValue1, typename TValue2>
template<typename TValue1, typename TValue2>
static void is_min(TValue1 value1, TValue2 value2,
const std::string& message) {is_min(value1, value2, message,
xtd::diagnostics::stack_frame());}
template<typename TValue1, typename TValue2>
try {
if (std::min(value1, value2) == value1)
else
base_assert::fail(
"lesser of " + base_assert::to_string(value2), base_assert::to_string(value1), message, stack_frame);
} catch (...) {
}
}
};
class test_class_(math_test) {
public:
math_assume::is_max(100, 20);
}
math_assume::is_max(20, 100);
}
};
auto main() -> int {
}
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:47
The base class for assert.
Definition base_assert.h:29
static void abort(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Abort current test. This is used by the other assert functions.
static void fail(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static void succeed(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Generates a success with a generic message. This is used by the other assert functions.
The console_unit_test class is console unit test interface.
Definition console_unit_test.h:23
int32 run() noexcept
Runs all tests in this unit_test object and prints the result.
#define test_method_(method_name)
Add test method to class test.
Definition test_method_attribute.h:73