The unit_test class is unit test base interface.
Constructors | |
unit_test (std::unique_ptr< xtd::tunit::event_listener > event_listener) noexcept | |
Initializes a new instance of xtd::tunit::unit_test with specified xtd::tunit::event_listener. More... | |
unit_test (std::unique_ptr< xtd::tunit::event_listener > event_listener, int argc, char *argv[]) noexcept | |
Initializes a new instance of xtd::tunit::unit_test with specified xtd::tunit::event_listener, argument counts and arguments array. More... | |
Properties | |
int32 | repeat_iteration () const noexcept |
Gets the repeat iteration number. A number between 0 and xtd::tunit::unit_test::repeat_iteration_count. More... | |
int32 | repeat_iteration_count () const noexcept |
Gets the repeat iteration count. More... | |
bool | repeat_tests () const noexcept |
Gets a boolean indictaes if there is repeat tests. More... | |
size_t | test_cases_count () const noexcept |
Gets the test cases count. More... | |
size_t | test_count () const noexcept |
Gets the test count. More... | |
size_t | aborted_test_count () const noexcept |
Gets the aborted test count. More... | |
std::vector< xtd::ustring > | aborted_test_names () const noexcept |
Gets the array of aborted test names. More... | |
std::chrono::milliseconds | elapsed_time () const noexcept |
Gets the elapsed time for the execution of all tests in the unit test. More... | |
size_t | ignored_test_count () const noexcept |
Gets the ignored test count. More... | |
std::vector< xtd::ustring > | ignored_test_names () const noexcept |
Gets the array of ignored test names. More... | |
size_t | failed_test_count () const noexcept |
Gets the failed test count. More... | |
std::vector< xtd::ustring > | failed_test_names () const noexcept |
Gets the array of failed test names. More... | |
size_t | succeed_test_count () const noexcept |
Gets the succeed test count. More... | |
std::vector< xtd::ustring > | succeed_test_names () const noexcept |
Gets the array of succeed test names. More... | |
Methods | |
int32 | run () |
Runs all tests in this unit_test object and prints the result. More... | |
Protected methods | |
virtual int32 | count_tests (int32 count) |
Counts the test names contained in the specified tests. More... | |
virtual int32 | list_tests (const std::vector< xtd::ustring > &tests) |
Lists the test names contained in the specified tests. More... | |
virtual bool | parse_arguments (const std::vector< ustring > &args) |
Parses the specified arguments. More... | |
|
explicitnoexcept |
Initializes a new instance of xtd::tunit::unit_test with specified xtd::tunit::event_listener.
event_listener | The event listener associate to the unit tests. |
|
noexcept |
Initializes a new instance of xtd::tunit::unit_test with specified xtd::tunit::event_listener, argument counts and arguments array.
event_listener | The event listener associate to the unit tests. |
argc | Argument count from main method. |
argv | Arguments array from main method. |
|
noexcept |
Gets the aborted test count.
|
noexcept |
Gets the array of aborted test names.
Counts the test names contained in the specified tests.
count | The tests count. |
Reimplemented in xtd::tunit::ostream_unit_test.
|
noexcept |
Gets the elapsed time for the execution of all tests in the unit test.
|
noexcept |
Gets the failed test count.
|
noexcept |
Gets the array of failed test names.
|
noexcept |
Gets the ignored test count.
|
noexcept |
Gets the array of ignored test names.
|
protectedvirtual |
Lists the test names contained in the specified tests.
tests | The list of test names. |
Reimplemented in xtd::tunit::ostream_unit_test.
|
protectedvirtual |
Parses the specified arguments.
The | arguments to parse. |
-help
argument is passed. Reimplemented in xtd::tunit::ostream_unit_test.
|
noexcept |
Gets the repeat iteration number. A number between 0 and xtd::tunit::unit_test::repeat_iteration_count.
|
noexcept |
Gets the repeat iteration count.
|
noexcept |
Gets a boolean indictaes if there is repeat tests.
int32 xtd::tunit::unit_test::run | ( | ) |
Runs all tests in this unit_test object and prints the result.
|
noexcept |
Gets the succeed test count.
|
noexcept |
Gets the array of succeed test names.
|
noexcept |
Gets the test cases count.
|
noexcept |