The unit_test class is unit test base interface.
Public Constructors | |
unit_test (xtd::uptr< xtd::tunit::event_listener > event_listener) noexcept | |
Initializes a new instance of xtd::tunit::unit_test with specified xtd::tunit::event_listener. | |
unit_test (xtd::uptr< 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. | |
Public Properties | |
int32 | repeat_iteration () const noexcept |
Gets the repeat iteration number. A number between 0 and xtd::tunit::unit_test::repeat_iteration_count. | |
int32 | repeat_iteration_count () const noexcept |
Gets the repeat iteration count. | |
bool | repeat_tests () const noexcept |
Gets a boolean indictaes if there is repeat tests. | |
size_t | test_cases_count () const noexcept |
Gets the test cases count. | |
size_t | test_count () const noexcept |
Gets the test count. | |
size_t | aborted_test_count () const noexcept |
Gets the aborted test count. | |
std::vector< xtd::string > | aborted_test_names () const noexcept |
Gets the array of aborted test names. | |
xtd::time_span | elapsed_time () const noexcept |
Gets the elapsed time for the execution of all tests in the unit test. | |
size_t | ignored_test_count () const noexcept |
Gets the ignored test count. | |
std::vector< xtd::string > | ignored_test_names () const noexcept |
Gets the array of ignored test names. | |
size_t | failed_test_count () const noexcept |
Gets the failed test count. | |
std::vector< xtd::string > | failed_test_names () const noexcept |
Gets the array of failed test names. | |
size_t | succeed_test_count () const noexcept |
Gets the succeed test count. | |
std::vector< xtd::string > | succeed_test_names () const noexcept |
Gets the array of succeed test names. | |
Public Methods | |
int32 | run () noexcept |
Runs all tests in this unit_test object and prints the result. | |
Protected Methods | |
virtual int32 | count_tests (int32 count) |
Counts the test names contained in the specified tests. | |
virtual int32 | list_tests (const std::vector< xtd::string > &tests) |
Lists the test names contained in the specified tests. | |
virtual bool | parse_arguments (const std::vector< string > &args) |
Parses the specified arguments. | |
|
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 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.
|
noexcept |
Gets the test cases count.
|
noexcept |
Gets the test count.
|
noexcept |
Gets the aborted test count.
|
noexcept |
Gets the array of aborted test names.
|
noexcept |
Gets the elapsed time for the execution of all tests in the unit test.
|
noexcept |
Gets the ignored test count.
|
noexcept |
Gets the array of ignored test names.
|
noexcept |
Gets the failed test count.
|
noexcept |
Gets the array of failed test names.
|
noexcept |
Gets the succeed test count.
|
noexcept |
Gets the array of succeed test names.
|
noexcept |
Runs all tests in this unit_test object and prints the result.
Counts the test names contained in the specified tests.
count | The tests count. |
Reimplemented in xtd::tunit::ostream_unit_test.
|
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.