Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed May 8, 2023
1 parent 243dde1 commit ea504a3
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,43 @@ auto main()->int {
}
```
**or**
```cpp
#include <xtd/xtd>
#include <string>
using namespace std;
using namespace xtd::tunit;
namespace unit_tests {
class hello_world_test;
test_class_attribute<hello_world_test> hello_world_test_class_attr {"hello_world_test"};
class hello_world_test : public test_class {
public:
test_method_attribute create_string_from_literal_attr {"create_string_from_literal", *this, &hello_world_test::create_string_from_literal};
void create_string_from_literal() {
string s = "Hello, World!";
valid::are_equal(13, s.size());
assert::are_equal("Hello, World!", s);
}
test_method_attribute create_string_from_chars_attr {"create_string_from_literal", *this, &hello_world_test::create_string_from_chars};
void create_string_from_chars() {
string s = {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
valid::are_equal(13, s.size());
string_assert::starts_with("Hello,", s);
string_assert::ends_with(" World!", s);
}
};
}
auto main()->int {
return console_unit_test().run();
}
```

#### CMakeLists.txt

```cmake
Expand Down

0 comments on commit ea504a3

Please sign in to comment.