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_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 current test. This is used by the other assert functions. | |
#define | all_items_are_instances_of_(type_t, ...) |
Asserts that all collection items are of the type supplied or a derived type. | |
#define | all_items_are_not_null_(...) |
Asserts that all collection items are not null. | |
#define | all_items_are_unique_(...) |
Asserts that all collection items are unique. | |
#define | are_equal_(...) |
Asserts that two type are equal. | |
#define | are_equal_ignoring_case_(...) |
Asserts that two type are equal ignoring case. | |
#define | are_equivalent_(...) |
Asserts that all collection items are equivalent. | |
#define | are_not_equal_(...) |
Asserts that two type are not equal. | |
#define | are_not_equal_ignoring_case_(...) |
Asserts that two type are not equal ignoring case. | |
#define | are_not_equivalent_(...) |
Asserts that all collection items are equivalent. | |
#define | are_not_same_(...) |
Asserts that two objects do refer to differents objects. | |
#define | are_same_(...) |
Asserts that two objects do refer to same objects. | |
#define | class_cleanup_(method_name) |
Add class cleanup method to class test. | |
#define | class_initialize_(method_name) |
add initialize class method to class test. | |
#define | contains_(...) |
Asserts that collection contains an item. | |
#define | does_not_end_with_(...) |
Asserts that string starts with item. | |
#define | does_not_exist_(...) |
Asserts that file not exists. | |
#define | does_not_match_(...) |
Asserts that does not match regex pattern. | |
#define | does_not_start_with_(...) |
Asserts that string starts with item. | |
#define | does_not_throw_(...) |
Asserts that the staement does not throw an exception. | |
#define | ends_with_(...) |
Asserts that string starts with item. | |
#define | exists_(...) |
Asserts that directory exists. | |
#define | fail_(...) |
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions. | |
#define | ignore_(...) |
Ignore current test. This is used by the other assert functions. | |
#define | ignore_test_method_(method_name) |
Add ignored test method to class test. | |
#define | is_empty_(...) |
Asserts that collection contains an item. | |
#define | is_false_(...) |
Asserts that a condition is false. | |
#define | is_greater_(...) |
Asserts that the first value is greater than the second value. | |
#define | is_greater_or_equal_(...) |
Asserts that the first value is greater than or equal to the second value. | |
#define | is_instance_of_(type_t, ...) |
Asserts that an object is of the type supplied or a derived type. | |
#define | is_less_(...) |
Asserts that the first value is is_less than the second value. | |
#define | is_less_or_equal_(...) |
Asserts that the first value is is_less than or equal to the second value. | |
#define | is_NaN_(...) |
Asserts that a value is NaN. | |
#define | is_negative_(...) |
Asserts that ta condition is negative. | |
#define | is_not_empty_(...) |
Asserts that collection does not contain any item. | |
#define | is_not_instance_of_(type_t, ...) |
Asserts that an object is not of the type supplied or a derived type. | |
#define | is_not_null_(...) |
Asserts that the pointer is not null. | |
#define | is_not_zero_(...) |
Asserts that ta condition is not zero. | |
#define | is_null_(...) |
Asserts that the pointer is null. | |
#define | is_ordered_(...) |
Asserts that collection is ordered. | |
#define | is_positive_(...) |
Asserts that ta condition is positive. | |
#define | is_true_(...) |
Asserts that a condition is true. | |
#define | is_zero_(...) |
Asserts that ta condition is zero. | |
#define | matches_(...) |
Asserts that matches regex pattern. | |
#define | starts_with_(...) |
Asserts that string starts with item. | |
#define | succeed_(...) |
Generates a success with a generic message. This is used by the other assert functions. | |
#define | test_class_(class_name) |
Helper to create a test_class in a test unit. | |
#define | test_class_from_(class_name, from_class_name) |
Helper to create a test_class in a test unit from a specified class base. | |
#define | test_cleanup_(method_name) |
Helper to create a test cleanup method in a test class. | |
#define | test_initialize_(method_name) |
Helper to create a test initialize method in a test class. | |
#define | test_method_(method_name) |
Add test method to class test. | |
#define | throws_(exception_t, ...) |
Asserts that the statement throws a particular exception when called. | |
#define | throws_any_(...) |
Asserts that the staement does not throw an exception. | |
#define | tunit_main_ |
Defines the entry point to be called with startup_ for unit test application. | |
#define | tunit_main_with_gtest_compatibility_ |
Defines the entry point to be called with startup_ for unit test application with Google test compatibility. | |
Enumerations | |
enum class | 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_ | ( | ) |
#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, | |
... | |||
) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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, | |
... | |||
) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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, | |
... | |||
) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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_ | ( | ... | ) |
#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, | |
... | |||
) |
#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_ | ( | ... | ) |
#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_ |
#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_ |
#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. |