assert_that
April 17, 2026 ยท View on GitHub
Shows how to use xtd::tunit::assert_that method.
Sources
Build and run
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run
Output
Start 3 tests from 1 test case
Run tests:
SUCCEED unit_tests::test.test_case1 [< 1 ms]
FAILED unit_tests::test.test_case2 [< 1 ms]
Expected: false
But was: true
Stack Trace: in |---OMITTED---|/assert_that.cpp:10
FAILED unit_tests::test.test_case3 [< 1 ms]
Expected: not string starting with "Hello"
But was: "Hello, Workd"
Stack Trace: in |---OMITTED---|/assert_that.cpp:14
Test results:
SUCCEED 1 test.
FAILED 2 tests.
End 3 tests from 1 test case ran. [0.0006 seconds]