#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>
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);
}
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>
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);
}
};
class test_class_(math_test) {
public:
math_assert::is_max(100, 20);
}
math_assert::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.hpp:47
The base class for assert.
Definition base_assert.hpp:29
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.hpp: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.hpp:73