Unit tests definitions.
|
Modules | |
| assertions | |
| Assertions definitions. | |
| assumptions | |
| Assumptions definitions. | |
| validations | |
| validations definitions | |
Classes | |
| class | xtd::tunit::base_assert |
| The base class for assert. More... | |
| class | xtd::tunit::class_cleanup_attribute |
| This attribute is use to add cleanup class method to class test attribute. More... | |
| class | xtd::tunit::class_event_args |
| Provides data for the xtd::tunit::class_test events. More... | |
| class | xtd::tunit::class_initialize_attribute |
| This attribute is use to add initialize class method to class test attribute. More... | |
| class | xtd::tunit::console_unit_test |
| The console_unit_test class is console unit test interface. More... | |
| class | xtd::tunit::event_listener |
| Represent the event listener class. Unit test call theses events when unit tests are processing. More... | |
| class | xtd::tunit::ostream_event_listener |
| The ostream_unit_test class is a specialisation of event_listener class for writing events in std::ostream. More... | |
| class | xtd::tunit::ostream_unit_test |
| The ostream_unit_test class is ostream unit test interface. More... | |
| class | xtd::tunit::registered_test_class |
| Represents the registered test class. More... | |
| class | xtd::tunit::settings |
| The settings class contains xtd.tunit settings. More... | |
| class | xtd::tunit::test |
| Represents a test method. More... | |
| class | xtd::tunit::test_class |
| Represents a test class. More... | |
| class | xtd::tunit::test_class_attribute< test_class_t > |
| Represents a test class attribute. More... | |
| class | xtd::tunit::test_cleanup_attribute |
| Represents a test cleanup attribute. More... | |
| class | xtd::tunit::test_event_args |
| Provides data for the xtd::tunit::test events. More... | |
| class | xtd::tunit::test_method_attribute |
| Represents a test method attribute. More... | |
| class | xtd::tunit::tunit_event_args |
| tunit_event_args is the base class for classes containing event data. More... | |
| class | xtd::tunit::unit_test |
| The unit_test class is unit test base interface. More... | |
Macros | |
| #define | abort_() abort(csf_) |
| Abort current test. This is used by the other assert functions. More... | |
| #define | all_items_are_instances_of_(type_t, ...) __CMD_ASSERT_ARGS(all_items_are_instances_of<type_t>, __VA_ARGS__) |
| Asserts that all collection items are of the type supplied or a derived type. More... | |
| #define | all_items_are_not_null_(...) __CMD_ASSERT_ARGS(all_items_are_not_null, __VA_ARGS__) |
| Asserts that all collection items are not null. More... | |
| #define | all_items_are_unique_(...) __CMD_ASSERT_ARGS(all_items_are_unique, __VA_ARGS__) |
| Asserts that all collection items are unique. More... | |
| #define | are_equal_(...) __CMD_ASSERT_ARGS(are_equal, __VA_ARGS__) |
| Asserts that two type are equal. More... | |
| #define | are_equal_ignoring_case_(...) __CMD_ASSERT_ARGS(are_equal_ignoring_case, __VA_ARGS__) |
| Asserts that two type are equal ignoring case. More... | |
| #define | are_equivalent_(...) __CMD_ASSERT_ARGS(are_equivalent, __VA_ARGS__) |
| Asserts that all collection items are equivalent. More... | |
| #define | are_not_equal_(...) __CMD_ASSERT_ARGS(are_not_equal, __VA_ARGS__) |
| Asserts that two type are not equal. More... | |
| #define | are_not_equal_ignoring_case_(...) __CMD_ASSERT_ARGS(are_not_equal_ignoring_case, __VA_ARGS__) |
| Asserts that two type are not equal ignoring case. More... | |
| #define | are_not_equivalent_(...) __CMD_ASSERT_ARGS(are_not_equivalent, __VA_ARGS__) |
| Asserts that all collection items are equivalent. More... | |
| #define | are_not_same_(...) __CMD_ASSERT_ARGS(are_not_same, __VA_ARGS__) |
| Asserts that two objects do refer to differents objects. More... | |
| #define | are_same_(...) __CMD_ASSERT_ARGS(are_same, __VA_ARGS__) |
| Asserts that two objects do refer to same objects. More... | |
| #define | class_cleanup_(method_name) |
| Add class cleanup method to class test. More... | |
| #define | class_initialize_(method_name) |
| add initialize class method to class test. More... | |
| #define | contains_(...) __CMD_ASSERT_ARGS(contains, __VA_ARGS__) |
| Asserts that collection contains an item. More... | |
| #define | does_not_end_with_(...) __CMD_ASSERT_ARGS(does_not_end_with, __VA_ARGS__) |
| Asserts that string starts with item. More... | |
| #define | does_not_exist_(...) __CMD_ASSERT_ARGS(does_not_exist, __VA_ARGS__) |
| Asserts that file not exists. More... | |
| #define | does_not_match_(...) __CMD_ASSERT_ARGS(does_not_match, __VA_ARGS__) |
| Asserts that does not match regex pattern. More... | |
| #define | does_not_start_with_(...) __CMD_ASSERT_ARGS(does_not_start_with, __VA_ARGS__) |
| Asserts that string starts with item. More... | |
| #define | does_not_throw_(...) __CMD_ASSERT_ARGS(does_not_throw, __VA_ARGS__) |
| Asserts that the staement does not throw an exception. More... | |
| #define | ends_with_(...) __CMD_ASSERT_ARGS(ends_with, __VA_ARGS__) |
| Asserts that string starts with item. More... | |
| #define | exists_(...) __CMD_ASSERT_ARGS(exists, __VA_ARGS__) |
| Asserts that directory exists. More... | |
| #define | fail_(...) __CMD_ASSERT_ARGS(fail, __VA_ARGS__) |
| Throws an xtd::tunit::assert_error exception. This is used by the other assert functions. More... | |
| #define | ignore_(...) __CMD_ASSERT_ARGS(ignore, __VA_ARGS__) |
| Ignore current test. This is used by the other assert functions. More... | |
| #define | ignore_test_method_(method_name) |
| Add ignored test method to class test. More... | |
| #define | is_empty_(...) __CMD_ASSERT_ARGS(is_empty, __VA_ARGS__) |
| Asserts that collection contains an item. More... | |
| #define | is_false_(...) __CMD_ASSERT_ARGS(is_false, __VA_ARGS__) |
| Asserts that a condition is false. More... | |
| #define | is_greater_(...) __CMD_ASSERT_ARGS(is_greater, __VA_ARGS__) |
| Asserts that the first value is greater than the second value. More... | |
| #define | is_greater_or_equal_(...) __CMD_ASSERT_ARGS(is_greater_or_equal, __VA_ARGS__) |
| Asserts that the first value is greater than or equal to the second value. More... | |
| #define | is_instance_of_(type_t, ...) __CMD_ASSERT_ARGS(is_instance_of<type_t>, __VA_ARGS__) |
| Asserts that an object is of the type supplied or a derived type. More... | |
| #define | is_less_(...) __CMD_ASSERT_ARGS(is_less, __VA_ARGS__) |
| Asserts that the first value is is_less than the second value. More... | |
| #define | is_less_or_equal_(...) __CMD_ASSERT_ARGS(is_less_or_equal, __VA_ARGS__) |
| Asserts that the first value is is_less than or equal to the second value. More... | |
| #define | is_NaN_(...) __CMD_ASSERT_ARGS(is_NaN, __VA_ARGS__) |
| Asserts that a value is NaN. More... | |
| #define | is_negative_(...) __CMD_ASSERT_ARGS(is_negative, __VA_ARGS__) |
| Asserts that ta condition is negative. More... | |
| #define | is_not_empty_(...) __CMD_ASSERT_ARGS(is_not_empty, __VA_ARGS__) |
| Asserts that collection does not contain any item. More... | |
| #define | is_not_instance_of_(type_t, ...) __CMD_ASSERT_ARGS(is_not_instance_of<type_t>, __VA_ARGS__) |
| Asserts that an object is not of the type supplied or a derived type. More... | |
| #define | is_not_null_(...) __CMD_ASSERT_ARGS(is_not_null, __VA_ARGS__) |
| Asserts that the pointer is not null. More... | |
| #define | is_not_zero_(...) __CMD_ASSERT_ARGS(is_not_zero, __VA_ARGS__) |
| Asserts that ta condition is not zero. More... | |
| #define | is_null_(...) __CMD_ASSERT_ARGS(is_null, __VA_ARGS__) |
| Asserts that the pointer is null. More... | |
| #define | is_ordered_(...) __CMD_ASSERT_ARGS(is_ordered, __VA_ARGS__) |
| Asserts that collection is ordered. More... | |
| #define | is_positive_(...) __CMD_ASSERT_ARGS(is_positive, __VA_ARGS__) |
| Asserts that ta condition is positive. More... | |
| #define | is_true_(...) __CMD_ASSERT_ARGS(is_true, __VA_ARGS__) |
| Asserts that a condition is true. More... | |
| #define | is_zero_(...) __CMD_ASSERT_ARGS(is_zero, __VA_ARGS__) |
| Asserts that ta condition is zero. More... | |
| #define | matches_(...) __CMD_ASSERT_ARGS(matches, __VA_ARGS__) |
| Asserts that matches regex pattern. More... | |
| #define | starts_with_(...) __CMD_ASSERT_ARGS(starts_with, __VA_ARGS__) |
| Asserts that string starts with item. More... | |
| #define | succeed_(...) __CMD_ASSERT_ARGS(succeed, __VA_ARGS__) |
| Generates a success with a generic message. This is used by the other assert functions. More... | |
| #define | test_class_(class_name) |
| Helper to create a test_class in a test unit. More... | |
| #define | test_class_from_(class_name, from_class_name) |
| Helper to create a test_class in a test unit from a specified class base. More... | |
| #define | test_cleanup_(method_name) |
| Helper to create a test cleanup method in a test class. More... | |
| #define | test_initialize_(method_name) |
| Helper to create a test initialize method in a test class. More... | |
| #define | test_method_(method_name) |
| Add test method to class test. More... | |
| #define | throws_(exception_t, ...) __CMD_ASSERT_ARGS(throws<exception_t>, __VA_ARGS__) |
| Asserts that the statement throws a particular exception when called. More... | |
| #define | throws_any_(...) __CMD_ASSERT_ARGS(throws_any, __VA_ARGS__) |
| Asserts that the staement does not throw an exception. More... | |
| #define | tunit_main_ __tunit_main::main |
| Defines the entry point to be called with startup_ for unit test application. More... | |
| #define | tunit_main_with_gtest_compatibility_ __tunit_main::main_with_gtest_compatibility |
| Defines the entry point to be called with startup_ for unit test application with Google test compatibility. More... | |
Enumerations | |
| enum | xtd::tunit::test_state { xtd::tunit::test_state::considered, xtd::tunit::test_state::ignored } |
| Represent the test state enumeration used bu test. More... | |
| #define abort_ | ( | ) | abort(csf_) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Abort current test. This is used by the other assert functions.
| xtd::tunit::assert_error | If bad assertion. |
| #define all_items_are_instances_of_ | ( | type_t, | |
| ... | |||
| ) | __CMD_ASSERT_ARGS(all_items_are_instances_of<type_t>, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/collection_assert.h>
Asserts that all collection items are of the type supplied or a derived type.
| value | The object to verify |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define all_items_are_not_null_ | ( | ... | ) | __CMD_ASSERT_ARGS(all_items_are_not_null, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/collection_assert.h>
Asserts that all collection items are not null.
| value | The object to verify |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define all_items_are_unique_ | ( | ... | ) | __CMD_ASSERT_ARGS(all_items_are_unique, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/collection_assert.h>
Asserts that all collection items are unique.
| value | The object to verify |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define are_equal_ | ( | ... | ) | __CMD_ASSERT_ARGS(are_equal, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that two type are equal.
| expected | the expected value. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results . |
| #define are_equal_ignoring_case_ | ( | ... | ) | __CMD_ASSERT_ARGS(are_equal_ignoring_case, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/string_assert.h>
Asserts that two type are equal ignoring case.
| expected | the expected value. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define are_equivalent_ | ( | ... | ) | __CMD_ASSERT_ARGS(are_equivalent, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/collection_assert.h>
Asserts that all collection items are equivalent.
| value | The object to verify |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define are_not_equal_ | ( | ... | ) | __CMD_ASSERT_ARGS(are_not_equal, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that two type are not equal.
| expected | the expected value. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results . |
| #define are_not_equal_ignoring_case_ | ( | ... | ) | __CMD_ASSERT_ARGS(are_not_equal_ignoring_case, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/string_assert.h>
Asserts that two type are not equal ignoring case.
| expected | the expected value. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define are_not_equivalent_ | ( | ... | ) | __CMD_ASSERT_ARGS(are_not_equivalent, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/collection_assert.h>
Asserts that all collection items are equivalent.
| value | The object to verify |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define are_not_same_ | ( | ... | ) | __CMD_ASSERT_ARGS(are_not_same, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that two objects do refer to differents objects.
| expected | the expected value. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define are_same_ | ( | ... | ) | __CMD_ASSERT_ARGS(are_same, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that two objects do refer to same objects.
| expected | the expected value. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define class_cleanup_ | ( | method_name | ) |
#include <xtd.tunit/include/xtd/tunit/class_cleanup_attribute.h>
Add class cleanup method to class test.
| method_name | The class cleanup method to add. |
| #define class_initialize_ | ( | method_name | ) |
#include <xtd.tunit/include/xtd/tunit/class_initialize_attribute.h>
add initialize class method to class test.
| method_name | The class initilize method to add. |
| #define contains_ | ( | ... | ) | __CMD_ASSERT_ARGS(contains, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that collection contains an item.
| item | object to verify. |
| collection | that contains object. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define does_not_end_with_ | ( | ... | ) | __CMD_ASSERT_ARGS(does_not_end_with, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/string_assert.h>
Asserts that string starts with item.
| item | object to verify. |
| collection | that contains object. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define does_not_exist_ | ( | ... | ) | __CMD_ASSERT_ARGS(does_not_exist, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/directory_assert.h>
Asserts that file not exists.
| expected | the expected value. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define does_not_match_ | ( | ... | ) | __CMD_ASSERT_ARGS(does_not_match, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/string_assert.h>
Asserts that does not match regex pattern.
| regex_pattern | the regex pattern. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define does_not_start_with_ | ( | ... | ) | __CMD_ASSERT_ARGS(does_not_start_with, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/string_assert.h>
Asserts that string starts with item.
| item | object to verify. |
| collection | that contains object. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define does_not_throw_ | ( | ... | ) | __CMD_ASSERT_ARGS(does_not_throw, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the staement does not throw an exception.
| statement | The statement that verify. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define ends_with_ | ( | ... | ) | __CMD_ASSERT_ARGS(ends_with, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/string_assert.h>
Asserts that string starts with item.
| item | object to verify. |
| collection | that contains object. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define exists_ | ( | ... | ) | __CMD_ASSERT_ARGS(exists, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/directory_assert.h>
Asserts that directory exists.
| expected | the expected value. |
| actual | the actual value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define fail_ | ( | ... | ) | __CMD_ASSERT_ARGS(fail, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| xtd::tunit::assert_error | If bad assertion. |
| #define ignore_ | ( | ... | ) | __CMD_ASSERT_ARGS(ignore, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Ignore current test. This is used by the other assert functions.
| message | A user facultative message to display if the assertion fails. This message can be seen in the unit test results. |
| #define ignore_test_method_ | ( | method_name | ) |
#include <xtd.tunit/include/xtd/tunit/test_method_attribute.h>
Add ignored test method to class test.
| method_name | The ignored test method to add. |
| #define is_empty_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_empty, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that collection contains an item.
| value | The value to check is empty. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_false_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_false, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that a condition is false.
| condition | The condition to check is false. |
| message | A facutative user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_greater_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_greater, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the first value is greater than the second value.
| val1 | the first value. |
| val2 | the second value. |
| message | A facutative user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_greater_or_equal_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_greater_or_equal, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the first value is greater than or equal to the second value.
| val1 | the first value. |
| val2 | the second value. |
| message | A facutative user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_instance_of_ | ( | type_t, | |
| ... | |||
| ) | __CMD_ASSERT_ARGS(is_instance_of<type_t>, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that an object is of the type supplied or a derived type.
| value | The object to verify |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_less_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_less, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the first value is is_less than the second value.
| val1 | the first value. |
| val2 | the second value. |
| message | A facutative user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_less_or_equal_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_less_or_equal, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the first value is is_less than or equal to the second value.
| val1 | the first value. |
| val2 | the second value. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_NaN_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_NaN, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that a value is NaN.
| value | The value to check is NaN. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_negative_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_negative, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that ta condition is negative.
| value | The value to check is negative. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_not_empty_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_not_empty, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that collection does not contain any item.
| value | The value to check is empty. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_not_instance_of_ | ( | type_t, | |
| ... | |||
| ) | __CMD_ASSERT_ARGS(is_not_instance_of<type_t>, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that an object is not of the type supplied or a derived type.
| value | The object to verify |
| message | A facutative user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_not_null_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_not_null, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the pointer is not null.
| pointer | The pointer to check is null. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_not_zero_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_not_zero, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that ta condition is not zero.
| value | The value to check is not zero. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_null_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_null, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the pointer is null.
| pointer | The pointer to check is null. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_ordered_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_ordered, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/collection_assert.h>
Asserts that collection is ordered.
| value | The value to check is empty. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_positive_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_positive, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that ta condition is positive.
| value | The value to check is positive. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_true_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_true, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that a condition is true.
| condition | The condition to check is true. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define is_zero_ | ( | ... | ) | __CMD_ASSERT_ARGS(is_zero, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that ta condition is zero.
| value | The value to check is zero. |
| message | A facutative user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define matches_ | ( | ... | ) | __CMD_ASSERT_ARGS(matches, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/string_assert.h>
Asserts that matches regex pattern.
| regex_pattern | the regex pattern. |
| actual | the actual value. |
| message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define starts_with_ | ( | ... | ) | __CMD_ASSERT_ARGS(starts_with, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/string_assert.h>
Asserts that string starts with item.
| item | object to verify. |
| collection | that contains object. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define succeed_ | ( | ... | ) | __CMD_ASSERT_ARGS(succeed, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Generates a success with a generic message. This is used by the other assert functions.
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define test_class_ | ( | class_name | ) |
#include <xtd.tunit/include/xtd/tunit/test_class_attribute.h>
Helper to create a test_class in a test unit.
| class_name | The test class to add to unit test. |
| #define test_class_from_ | ( | class_name, | |
| from_class_name | |||
| ) |
#include <xtd.tunit/include/xtd/tunit/test_class_attribute.h>
Helper to create a test_class in a test unit from a specified class base.
| class_name | The name of the test class. |
derived_class inherited from base_class : | #define test_cleanup_ | ( | method_name | ) |
#include <xtd.tunit/include/xtd/tunit/test_cleanup_attribute.h>
Helper to create a test cleanup method in a test class.
| method_name | The test cleanup method to add. |
| #define test_initialize_ | ( | method_name | ) |
#include <xtd.tunit/include/xtd/tunit/test_initialize_attribute.h>
Helper to create a test initialize method in a test class.
| method_name | The name of the test initialize method. |
| #define test_method_ | ( | method_name | ) |
#include <xtd.tunit/include/xtd/tunit/test_method_attribute.h>
Add test method to class test.
| method_name | The test method to add. |
| #define throws_ | ( | exception_t, | |
| ... | |||
| ) | __CMD_ASSERT_ARGS(throws<exception_t>, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the statement throws a particular exception when called.
| exception_t | The exception type that must be throw. |
| statement | The statement that verify. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define throws_any_ | ( | ... | ) | __CMD_ASSERT_ARGS(throws_any, __VA_ARGS__) |
#include <xtd.tunit/include/xtd/tunit/assert.h>
Asserts that the staement does not throw an exception.
| statement | The statement that verify. |
| message | An optional user message to display if the assertion fails. This message can be seen in the unit test results. |
| #define tunit_main_ __tunit_main::main |
#include <xtd.tunit/include/xtd/tunit/tunit_main.h>
Defines the entry point to be called with startup_ for unit test application.
| #define tunit_main_with_gtest_compatibility_ __tunit_main::main_with_gtest_compatibility |
#include <xtd.tunit/include/xtd/tunit/tunit_main.h>
Defines the entry point to be called with startup_ for unit test application with Google test compatibility.
|
strong |
#include <xtd.tunit/include/xtd/tunit/test_state.h>
Represent the test state enumeration used bu test.
| Enumerator | |
|---|---|
| considered | Test is considered. |
| ignored | Test is ignored. |