The classic first application "Hello, World!" with xtd::tunit::console_unit_test class.
#include <xtd/xtd>
namespace unit_tests {
class test_class_(hello_world_test) {
auto s = string {"Hello, World!"};
valid_that(s.length()).is().equal_to(13_z);
assert_that(s).is().equal_to("Hello, World!");
}
auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
valid_that(s.length()).is().equal_to(13_z);
assert_that(s).does().start_with("Hello,").and_().does().end_with(" World!");
}
};
}
auto main() -> int {
return console_unit_test {}.run();
}
#define test_method_(method_name)
Add test method to class test.
Definition test_method_attribute.hpp:72