@@ -272,15 +272,14 @@ namespace unit_tests {
272272 class test_class_ (hello_world_test) {
273273 auto test_method_ (create_string_from_literal) {
274274 auto s = string {"Hello, World!"};
275- valid::are_equal(13_z, s.length());
276- assert::are_equal( "Hello, World!", s );
275+ valid_that( s.length()).is().equal_to(13_z );
276+ assert_that(s).is().equal_to( "Hello, World!");
277277 }
278278
279279 auto test_method_ (create_string_from_chars) {
280280 auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
281- valid::are_equal(13_z, s.length());
282- string_assert::starts_with("Hello,", s);
283- string_assert::does_not_end_with(" le monde!", s);
281+ valid_that(s.length()).is().equal_to(13_z);
282+ assert_that(s).does().start_with("Hello,").and_ ().does().end_with(" World!");
284283 }
285284 };
286285}
@@ -290,29 +289,24 @@ auto main() -> int {
290289}
291290```
292291
293- **or without helpers **
292+ **or without constraints **
294293
295294```cpp
296295#include <xtd/xtd>
297296
298297namespace unit_tests {
299- class hello_world_test;
300-
301- auto hello_world_test_class_attr = test_class_attribute<hello_world_test> {"unit_tests::hello_world_test"};
302- class hello_world_test : public test_class {
303- test_method_attribute create_string_from_literal_attr {"create_string_from_literal", *this, &hello_world_test::create_string_from_literal};
304- auto create_string_from_literal() -> void {
298+ class test_class_(hello_world_test) {
299+ auto test_method_(create_string_from_literal) {
305300 auto s = string {"Hello, World!"};
306301 valid::are_equal(13_z, s.length());
307302 assert::are_equal("Hello, World!", s);
308303 }
309304
310- test_method_attribute create_string_from_chars_attr {"create_string_from_chars", *this, &hello_world_test::create_string_from_chars};
311- auto create_string_from_chars() -> void {
305+ auto test_method_(create_string_from_chars) {
312306 auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
313307 valid::are_equal(13_z, s.length());
314308 string_assert::starts_with("Hello,", s);
315- string_assert::does_not_end_with (" le monde !", s);
309+ string_assert::does_end_with (" World !", s);
316310 }
317311 };
318312}
0 commit comments