xtd 0.2.0
unit tests

Definition

Unit tests definitions.

Collaboration diagram for unit tests:

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...
 

Macro Definition Documentation

◆ abort_

#define abort_ ( )    abort(csf_)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Abort current test. This is used by the other assert functions.

Exceptions
xtd::tunit::assert_errorIf bad assertion.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::abort_(); // test throws an abort_error exception.
xtd::tunit::assume::abort_(); // test throws an abort_error exception.
xtd::tunit::valid::abort_(); // test throws an abort_error exception.

◆ all_items_are_instances_of_

#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.

Parameters
valueThe object to verify
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::collection_assert, xtd::tunit::collection_assume and xtd::tunit::collection_valid classes.
Examples
std::vector<std::ios_base*> a = {&std::cout, &std::cerr, &std::cin};
xtd::tunit::collection_assert::all_items_are_instances_of_(std::basic_ostream<char>*, a, "User message..."); // test error.
xtd::tunit::collection_assume::all_items_are_instances_of_(std::basic_ostream<char>*, a, "User message..."); // test error.
xtd::tunit::collection_valid::all_items_are_instances_of_(std::basic_ostream<char>*, a, "User message..."); // test error.

◆ all_items_are_not_null_

#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.

Parameters
valueThe object to verify
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::collection_assert, xtd::tunit::collection_assume and xtd::tunit::collection_valid classes.
Examples
int i1 = 0, i2 = 3;
std::vector<int*> a1 = {&i1, &i2};
std::vector<int*> a2 = {&i1, &i2, nullptr};
xtd::tunit::collection_assert::all_items_are_not_null_(a2, "User message..."); // test error.
xtd::tunit::collection_assume::all_items_are_not_null_(a2, "User message..."); // test error.
xtd::tunit::collection_valid::all_items_are_not_null_(a2, "User message..."); // test error.

◆ all_items_are_unique_

#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.

Parameters
valueThe object to verify
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::collection_assert, xtd::tunit::collection_assume and xtd::tunit::collection_valid classes.
Examples
std::vector<int> a1 = {1, 2, 3, 4};
std::vector<int> a2 = {1, 2, 3, 4, 1};
xtd::tunit::collection_assert::all_items_are_unique_(a2, "User message..."); // test error.
xtd::tunit::collection_assume::all_items_are_unique_(a2, "User message..."); // test error.
xtd::tunit::collection_valid::all_items_are_unique_(a2, "User message..."); // test error.

◆ are_equal_

#define are_equal_ (   ...)    __CMD_ASSERT_ARGS(are_equal, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results .
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::are_equal_(24, int(24)); // test throws an abort_error exception.
xtd::tunit::assume::are_equal_(24, int(24), "User message"); // test throws an abort_error exception.
xtd::tunit::valid::are_equal_(24, int(24)); // test throws an abort_error exception.
Examples:
many_valids_and_asserts.cpp.

◆ are_equal_ignoring_case_

#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.

Parameters
expectedthe expected value.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples
xtd::tunit::string_assert::are_equal_ignoring_case_("key", xtd::ustring("VALUE"), "User message..."); // test error.
xtd::tunit::string_assume::are_equal_ignoring_case_("key", xtd::ustring("VALUE"), "User message..."); // test error.
xtd::tunit::string_valid::are_equal_ignoring_case_("key", xtd::ustring("VALUE"), "User message..."); // test error.

◆ are_equivalent_

#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.

Parameters
valueThe object to verify
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::collection_assert, xtd::tunit::collection_assume and xtd::tunit::collection_valid classes.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assert::are_equivalent_({1, 2, 3, 5}, a, "User message..."); // test error.
xtd::tunit::collection_assume::are_equivalent_({1, 2, 3, 5}, a, "User message..."); // test error.
xtd::tunit::collection_valid::are_equivalent_({1, 2, 3, 5}, a, "User message..."); // test error.

◆ are_not_equal_

#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.

Parameters
expectedthe expected value.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results .
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::are_not_equal_(24, int(42)); // test throws an abort_error exception.
xtd::tunit::assume::are_not_equal_(24, int(42), "User message..."); // test throws an abort_error exception.
xtd::tunit::valid::are_not_equal_(24, int(42)); // test throws an abort_error exception.

◆ are_not_equal_ignoring_case_

#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.

Parameters
expectedthe expected value.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples

◆ are_not_equivalent_

#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.

Parameters
valueThe object to verify
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::collection_assert, xtd::tunit::collection_assume and xtd::tunit::collection_valid classes.
Examples
std::vector<int> a = {1, 2, 3, 4};
xtd::tunit::collection_assert::are_equivalent_({1, 2, 3, 5}, a, "User message..."); // test error.
xtd::tunit::collection_assume::are_equivalent_({1, 2, 3, 5}, a, "User message..."); // test error.
xtd::tunit::collection_valid::are_equivalent_({4, 3, 2, 1}, a); // test ok.
xtd::tunit::collection_valid::are_equivalent_({1, 2, 3, 5}, a, "User message..."); // test error.

◆ are_not_same_

#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.

Parameters
expectedthe expected value.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
int a = 24;
int& b = a;
int c= 24;
xtd::tunit::assert::are_not_same_(b, a, "User message..."); // test error.
xtd::tunit::assume::are_not_same_(b, a, "User message..."); // test error.
xtd::tunit::valid::are_not_same_(b, a, "User message..."); // test error.

◆ are_same_

#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.

Parameters
expectedthe expected value.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
int a = 24;
int& b = a;
int c= 24;
xtd::tunit::assert::are__same_(c, a, "User message..."); // test error.
xtd::tunit::assume::are_same_(c, a, "User message..."); // test error.
xtd::tunit::valid::are_same_(c, a, "User message..."); // test error.
xtd::tunit::valid::are_same_(b, a); // test ok.

◆ class_cleanup_

#define class_cleanup_ (   method_name)

#include <xtd.tunit/include/xtd/tunit/class_cleanup_attribute.h>

Value:
__##method_name##_static() {} \
class __class_cleanup_attribute : public xtd::tunit::class_cleanup_attribute { \
public:\
template<typename test_class> __class_cleanup_attribute(test_class& test) : class_cleanup_attribute(#method_name, test, &method_name, {__FILE__, __LINE__, __func__}) {__##method_name##_static();} \
} __class_cleanup_attribute {*this}; \
static void method_name()
This attribute is use to add cleanup class method to class test attribute.
Definition: class_cleanup_attribute.h:21

Add class cleanup method to class test.

Parameters
method_nameThe class cleanup method to add.
Library
xtd.tunit
Examples
The following example shows how to use class_cleanup_ helper.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
// The class test must be declared with test_class_ helper.
class test_class_(test) {
public:
// This method is the method that is called just before the start of all tests. It is called only once.
static void class_initialize_(class_initialize) {
}
// This method is the method that is called just after all the tests are finished. It is called only once.
static void class_cleanup_(class_cleanup) {
}
// This method is the method that is called just before a test method starts. It is called for each test.
static void test_initialize_(test_initialize) {
}
// This method is the method that is called right after a test method is finished. It is called for each test.
static void test_cleanup_(test_cleanup) {
}
void test_method_(test_case1) {
}
void test_method_(test_case2) {
}
void ignore_test_method_(test_case3) {
}
};
}
auto main()->int {
return console_unit_test().run();
}
// This code can produce the following output:
//
// Start 3 tests from 1 test case
// Run tests:
// SUCCEED test.test_case1 (0 ms total)
// SUCCEED test.test_case2 (0 ms total)
// IGNORED test.test_case3 (0 ms total)
// Test ignored
//
// Test results:
// SUCCEED 2 tests.
// IGNORED 1 test.
// End 3 tests from 1 test case ran. (0 ms total)
Examples:
test_class.cpp.

◆ class_initialize_

#define class_initialize_ (   method_name)

#include <xtd.tunit/include/xtd/tunit/class_initialize_attribute.h>

Value:
__##method_name##_static() {} \
class __class_initialize_attribute : public xtd::tunit::class_initialize_attribute { \
public:\
template<typename test_class> __class_initialize_attribute(test_class& test) : class_initialize_attribute(#method_name, test, &method_name, {__FILE__, __LINE__, __func__}) {__##method_name##_static();} \
} __class_initialize_attribute {*this}; \
static void method_name()
This attribute is use to add initialize class method to class test attribute.
Definition: class_initialize_attribute.h:21

add initialize class method to class test.

Parameters
method_nameThe class initilize method to add.
Library
xtd.tunit
Examples
The following example shows how to use class_initialize_ helper.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
// The class test must be declared with test_class_ helper.
class test_class_(test) {
public:
// This method is the method that is called just before the start of all tests. It is called only once.
static void class_initialize_(class_initialize) {
}
// This method is the method that is called just after all the tests are finished. It is called only once.
static void class_cleanup_(class_cleanup) {
}
// This method is the method that is called just before a test method starts. It is called for each test.
static void test_initialize_(test_initialize) {
}
// This method is the method that is called right after a test method is finished. It is called for each test.
static void test_cleanup_(test_cleanup) {
}
void test_method_(test_case1) {
}
void test_method_(test_case2) {
}
void ignore_test_method_(test_case3) {
}
};
}
auto main()->int {
return console_unit_test().run();
}
// This code can produce the following output:
//
// Start 3 tests from 1 test case
// Run tests:
// SUCCEED test.test_case1 (0 ms total)
// SUCCEED test.test_case2 (0 ms total)
// IGNORED test.test_case3 (0 ms total)
// Test ignored
//
// Test results:
// SUCCEED 2 tests.
// IGNORED 1 test.
// End 3 tests from 1 test case ran. (0 ms total)
Examples:
test_class.cpp.

◆ contains_

#define contains_ (   ...)    __CMD_ASSERT_ARGS(contains, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that collection contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
xtd::tunit::assert::contains_(2, v1); // test ok.
xtd::tunit::assert::contains_(4, v1, "User message..."); // test error.
xtd::tunit::assume::contains_(2, v1); // test ok.
xtd::tunit::assume::contains_(4, v1, "User message..."); // test error.
xtd::tunit::valid::contains_(2, v1); // test ok.
xtd::tunit::valid::contains_(4, v1, "User message..."); // test error.
Examples:
many_valids_and_asserts.cpp.

◆ does_not_end_with_

#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.

Parameters
itemobject to verify.
collectionthat contains object.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assert::does_not_end_with_("lue", s, "User message..."); // test error.
xtd::tunit::string_assume::does_not_end_with_("lue", s, "User message..."); // test error.
xtd::tunit::string_valid::does_not_end_with_("lue", s, "User message..."); // test error.

◆ does_not_exist_

#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.

Parameters
expectedthe expected value.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::directory_assert, xtd::tunit::directory_assume and xtd::tunit::directory_valid classes.
Examples
std::ifstream f1("Test1.txt");
f1.close();
xtd::tunit::directory_assert::does_not_exist_("Test1.txt", "User message..."); // test error.

◆ does_not_match_

#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.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples
xtd::tunit::string_assert::does_not_match_("^Salut", xtd::ustring("Hello, World!")); // test ok.
xtd::tunit::string_assert::does_not_match_("^Hello", xtd::ustring("Hello, World!"), "User message..."); // test error.
xtd::tunit::string_assume::does_not_match_("^Salut", xtd::ustring("Hello, World!")); // test ok.
xtd::tunit::string_assume::does_not_match_("^Hello", xtd::ustring("Hello, World!"), "User message..."); // test error.
xtd::tunit::string_valid::does_not_match_("^Salut", xtd::ustring("Hello, World!")); // test ok.
xtd::tunit::string_valid::does_not_match_("^Hello", xtd::ustring("Hello, World!"), "User message..."); // test error.

◆ does_not_start_with_

#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.

Parameters
itemobject to verify.
collectionthat contains object.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assert::does_not_start_with_("val", s, "User message..."); // test error.
xtd::tunit::string_assume::does_not_start_with_("val", s, "User message..."); // test error.
xtd::tunit::string_valid::does_not_start_with_("val", s, "User message..."); // test error.

◆ does_not_throw_

#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.

Parameters
statementThe statement that verify.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
xtd::tunit::assert::does_not_throw_([&] {v1.at(2);}); // test ok.
xtd::tunit::assert::does_not_throw_([&] {v1.at(5);}, "User message..."); // test error.
xtd::tunit::assume::does_not_throw_([&] {v1.at(2);}); // test ok.
xtd::tunit::assume::does_not_throw_([&] {v1.at(5);}, "User message..."); // test error.
xtd::tunit::valid::does_not_throw_([&] {v1.at(2);}); // test ok.
xtd::tunit::valid::does_not_throw_([&] {v1.at(5);}, "User message..."); // test error.

◆ ends_with_

#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.

Parameters
itemobject to verify.
collectionthat contains object.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assert::ends_with_("law", s, "User message..."); // test error.
xtd::tunit::string_assume::ends_with_("law", s, "User message..."); // test error.
xtd::tunit::string_valid::ends_with_("law", s, "User message..."); // test error.
Examples:
many_valids_and_asserts.cpp.

◆ exists_

#define exists_ (   ...)    __CMD_ASSERT_ARGS(exists, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/directory_assert.h>

Asserts that directory exists.

Parameters
expectedthe expected value.
actualthe actual value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::directory_assert, xtd::tunit::directory_assume and xtd::tunit::directory_valid classes.
Examples
std::ifstream f1("Test1.txt");
f1.close();
xtd::tunit::directory_assert::exists_("Test1.txt"); // test ok.
xtd::tunit::directory_assert::exists_("Test2.txt", "User message..."); // test error.

◆ fail_

#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.

Parameters
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::assert_errorIf bad assertion.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::fail_("User message..."); // test throws an assert_error exception.
xtd::tunit::assume::fail_("User message..."); // test throws an assert_error exception.
xtd::tunit::valid::fail_("User message..."); // test throws an assert_error exception.

◆ ignore_

#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.

Parameters
messageA user facultative message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::ignore_("User message..."); // test throws an ignore_error exception.
xtd::tunit::assume::ignore_("User message..."); // test throws an ignore_error exception.
xtd::tunit::valid::ignore_("User message..."); // test throws an ignore_error exception.

◆ ignore_test_method_

#define ignore_test_method_ (   method_name)

#include <xtd.tunit/include/xtd/tunit/test_method_attribute.h>

Value:
__##method_name##_unused() = delete; \
class __##method_name##_attribute##_class : public xtd::tunit::test_method_attribute { \
public:\
template<typename test_class> __##method_name##_attribute##_class(test_class& test) : test_method_attribute(#method_name, test, &test_class::method_name, xtd::tunit::test_state::ignored, {__FILE__, __LINE__, __func__}) {} \
} __##method_name##_attribute {*this}; \
void method_name()
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents a test method attribute.
Definition: test_method_attribute.h:22
test_state
Represent the test state enumeration used bu test.
Definition: test_state.h:18

Add ignored test method to class test.

Parameters
method_nameThe ignored test method to add.
Library
xtd.tunit
Remarks
This helper is used to ingor a test method. You can use the xtd::tunit::assert::ignore method instead.
Examples
The following example shows how to use ignore_test_method_ helper.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
// The class test must be declared with test_class_ helper.
class test_class_(test) {
public:
// This method is the method that is called just before the start of all tests. It is called only once.
static void class_initialize_(class_initialize) {
}
// This method is the method that is called just after all the tests are finished. It is called only once.
static void class_cleanup_(class_cleanup) {
}
// This method is the method that is called just before a test method starts. It is called for each test.
static void test_initialize_(test_initialize) {
}
// This method is the method that is called right after a test method is finished. It is called for each test.
static void test_cleanup_(test_cleanup) {
}
void test_method_(test_case1) {
}
void test_method_(test_case2) {
}
void ignore_test_method_(test_case3) {
}
};
}
auto main()->int {
return console_unit_test().run();
}
// This code can produce the following output:
//
// Start 3 tests from 1 test case
// Run tests:
// SUCCEED test.test_case1 (0 ms total)
// SUCCEED test.test_case2 (0 ms total)
// IGNORED test.test_case3 (0 ms total)
// Test ignored
//
// Test results:
// SUCCEED 2 tests.
// IGNORED 1 test.
// End 3 tests from 1 test case ran. (0 ms total)
Examples:
create_gtest_like_event_listener.cpp, and test_class.cpp.

◆ is_empty_

#define is_empty_ (   ...)    __CMD_ASSERT_ARGS(is_empty, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that collection contains an item.

Parameters
valueThe value to check is empty.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
xtd::tunit::assert::is_empty_(v2, "User message..."); // test error.
xtd::tunit::assume::is_empty_(v2, "User message..."); // test error.
xtd::tunit::valid::is_empty_(v2, "User message..."); // test error.

◆ is_false_

#define is_false_ (   ...)    __CMD_ASSERT_ARGS(is_false, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that a condition is false.

Parameters
conditionThe condition to check is false.
messageA facutative user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::string s1 = "Anything";
std::string s2;
xtd::tunit::assert::is_false_(std::empty(s1)); // test ok.
xtd::tunit::assert::is_false_(std::empty(s2), "User message..."); // test error.
xtd::tunit::assume::is_false_(std::empty(s1)); // test ok.
xtd::tunit::assume::is_false_(std::empty(s2), "User message..."); // test error.
xtd::tunit::valid::is_false_(std::empty(s1)); // test ok.
xtd::tunit::valid::is_false_(std::empty(s2), "User message..."); // test error.

◆ is_greater_

#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.

Parameters
val1the first value.
val2the second value.
messageA facutative user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::is_greater_(24, 12); // test ok.
xtd::tunit::assert::is_greater_(24, 48, "User message..."); // test error.
xtd::tunit::assume::is_greater_(24, 12); // test ok.
xtd::tunit::assume::is_greater_(24, 48, "User message..."); // test error.
xtd::tunit::valid::is_greater_(24, 12); // test ok.
xtd::tunit::valid::is_greater_(24, 48, "User message..."); // test error.

◆ is_greater_or_equal_

#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.

Parameters
val1the first value.
val2the second value.
messageA facutative user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::is_greater_or_equal_(24, 48, "User message..."); // test error.
xtd::tunit::assume::is_greater_or_equal_(24, 48, "User message..."); // test error.
xtd::tunit::valid::is_greater_or_equal_(24, 48, "User message..."); // test error.

◆ is_instance_of_

#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.

Parameters
valueThe object to verify
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::invalid_argument except("invalid argument");
xtd::tunit::assert::is_instance_of_(std::logic_error, except; // test ok.
xtd::tunit::assert::is_instance_of_(std::bad_cast, except, "User message..."); // test error.
xtd::tunit::assume::is_instance_of_(std::logic_error, except; // test ok.
xtd::tunit::assume::is_instance_of_(std::bad_cast, except, "User message..."); // test error.
xtd::tunit::valid::is_instance_of_(std::logic_error, except; // test ok.
xtd::tunit::valid::is_instance_of_(std::bad_cast, except, "User message..."); // test error.

◆ is_less_

#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.

Parameters
val1the first value.
val2the second value.
messageA facutative user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::is_less_(24, 48); // test ok.
xtd::tunit::assert::is_less_(24, 12, "User message..."); // test error.
xtd::tunit::assume::is_less_(24, 48); // test ok.
xtd::tunit::assume::is_less_(24, 12, "User message..."); // test error.
xtd::tunit::valid::is_less_(24, 48); // test ok.
xtd::tunit::valid::is_less_(24, 12, "User message..."); // test error.

◆ is_less_or_equal_

#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.

Parameters
val1the first value.
val2the second value.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::is_less_or_equal_(24, 12, "User message..."); // test error.
xtd::tunit::assume::is_less_or_equal_(24, 12, "User message..."); // test error.
xtd::tunit::valid::is_less_or_equal_(24, 12, "User message..."); // test error.

◆ is_NaN_

#define is_NaN_ (   ...)    __CMD_ASSERT_ARGS(is_NaN, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that a value is NaN.

Parameters
valueThe value to check is NaN.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
double v1 = std::numeric_limits<double>::quiet_NaN();
double v2 = 3.14159265358979323846;
xtd::tunit::assert::is_NaN_(v2, "User message..."); // test error.
xtd::tunit::assume::is_NaN_(v2, "User message..."); // test error.
xtd::tunit::valid::is_NaN_(v2, "User message..."); // test error.

◆ is_negative_

#define is_negative_ (   ...)    __CMD_ASSERT_ARGS(is_negative, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that ta condition is negative.

Parameters
valueThe value to check is negative.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
int i1 = -1;
int i2 = 1;
xtd::tunit::assert::is_negative_(i2, "User message..."); // test error.
xtd::tunit::assume::is_negative_(i2, "User message..."); // test error.
xtd::tunit::valid::is_negative_(i2, "User message..."); // test error.

◆ is_not_empty_

#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.

Parameters
valueThe value to check is empty.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
xtd::tunit::assert::is_not_empty_(v2, "User message..."); // test error.
xtd::tunit::assume::is_not_empty_(v2, "User message..."); // test error.
xtd::tunit::valid::is_not_empty_(v2, "User message..."); // test error.

◆ is_not_instance_of_

#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.

Parameters
valueThe object to verify
messageA facutative user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::invalid_argument except("invalid argument");
xtd::tunit::assert::is_not_instance_of_(std::bad_cast, except); // test ok.
xtd::tunit::assert::is_not_instance_of_(std::logic_error, except, "User message..."); // test error.
xtd::tunit::assume::is_not_instance_of_(std::bad_cast, except); // test ok.
xtd::tunit::assume::is_not_instance_of_(std::logic_error, except, "User message..."); // test error.
xtd::tunit::valid::is_not_instance_of_(std::bad_cast, except); // test ok.
xtd::tunit::valid::is_not_instance_of_(std::logic_error, except, "User message..."); // test error.

◆ is_not_null_

#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.

Parameters
pointerThe pointer to check is null.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::string str = "Anything";
std::string* s1 = &str;
std::string* s2 = nullptr;
xtd::tunit::assert::is_not_null_(s2, "User message..."); // test error.
xtd::tunit::assume::is_not_null_(s2, "User message..."); // test error.
xtd::tunit::valid::is_not_null_(s2, "User message..."); // test error.

◆ is_not_zero_

#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.

Parameters
valueThe value to check is not zero.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
int i1 = 42;
int i2 = 0;
xtd::tunit::assert::is_not_zero_(i2, "User message..."); // test error.
xtd::tunit::assume::is_not_zero_(i2, "User message..."); // test error.
xtd::tunit::valid::is_not_zero_(i2, "User message..."); // test error.

◆ is_null_

#define is_null_ (   ...)    __CMD_ASSERT_ARGS(is_null, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::string str = "Anything";
std::string* s1 = nullptr;
std::string* s2 = &str;
xtd::tunit::assert::is_null_(s2, "User message..."); // test error.
xtd::tunit::assume::is_null_(s2, "User message..."); // test error.
xtd::tunit::valid::is_null_(s2, "User message..."); // test error.

◆ is_ordered_

#define is_ordered_ (   ...)    __CMD_ASSERT_ARGS(is_ordered, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/collection_assert.h>

Asserts that collection is ordered.

Parameters
valueThe value to check is empty.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::collection_assert, xtd::tunit::collection_assume and xtd::tunit::collection_valid classes.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
std::vector<int> v2 = {1, 2, 4, 3};
xtd::tunit::collection_assert::is_ordered_(v2, "User message..."); // test error.
xtd::tunit::collection_assume::is_ordered_(v2, "User message..."); // test error.
xtd::tunit::collection_valid::is_ordered_(v2, "User message..."); // test error.

◆ is_positive_

#define is_positive_ (   ...)    __CMD_ASSERT_ARGS(is_positive, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that ta condition is positive.

Parameters
valueThe value to check is positive.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
int i1 = 1;
int i2 = -1;
xtd::tunit::assert::is_positive_(i2, "User message..."); // test error.
xtd::tunit::assume::is_positive_(i2, "User message..."); // test error.
xtd::tunit::valid::is_positive_(i2, "User message..."); // test error.

◆ is_true_

#define is_true_ (   ...)    __CMD_ASSERT_ARGS(is_true, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that a condition is true.

Parameters
conditionThe condition to check is true.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::string s1;
std::string s2 = "Anything";
xtd::tunit::assert::is_false_(std::empty(s1)); // test ok.
xtd::tunit::assert::is_false_(std::empty(s2), "User message..."); // test error.
xtd::tunit::assume::is_false_(std::empty(s1)); // test ok.
xtd::tunit::assume::is_false_(std::empty(s2), "User message..."); // test error.
xtd::tunit::valid::is_false_(std::empty(s1)); // test ok.
xtd::tunit::valid::is_false_(std::empty(s2), "User message..."); // test error.

◆ is_zero_

#define is_zero_ (   ...)    __CMD_ASSERT_ARGS(is_zero, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that ta condition is zero.

Parameters
valueThe value to check is zero.
messageA facutative user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
int i1 = 0;
int i2 = 42;
xtd::tunit::assert::is_zero_(i2, "User message..."); // test error.
xtd::tunit::assume::is_zero_(i2, "User message..."); // test error.
xtd::tunit::valid::is_zero_(i2, "User message..."); // test error.

◆ matches_

#define matches_ (   ...)    __CMD_ASSERT_ARGS(matches, __VA_ARGS__)

#include <xtd.tunit/include/xtd/tunit/string_assert.h>

Asserts that matches regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples
xtd::tunit::string_assert::matches_("^Hello", xtd::ustring("Hello, World!")); // test ok.
xtd::tunit::string_assert::matches_("^Salut", xtd::ustring("Hello, World!"), "User message..."); // test error.
xtd::tunit::string_assume::matches_("^Hello", xtd::ustring("Hello, World!")); // test ok.
xtd::tunit::string_assume::matches_("^Salut", xtd::ustring("Hello, World!"), "User message..."); // test error.
xtd::tunit::string_valid::matches_("^Hello", xtd::ustring("Hello, World!")); // test ok.
xtd::tunit::string_valid::matches_("^Salut", xtd::ustring("Hello, World!"), "User message..."); // test error.

◆ starts_with_

#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.

Parameters
itemobject to verify.
collectionthat contains object.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::string_assert, xtd::tunit::string_assume and xtd::tunit::string_valid classes.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assert::starts_with_("zoe", s, "User message..."); // test error.
xtd::tunit::string_assume::starts_with_("zoe", s, "User message..."); // test error.
xtd::tunit::string_valid::starts_with_("zoe", s, "User message..."); // test error.
Examples:
many_valids_and_asserts.cpp.

◆ succeed_

#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.

Parameters
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
xtd::tunit::assert::succeed("User message..."); // test ok.
xtd::tunit::assume::succeed("User message..."); // test ok.
xtd::tunit::valid::succeed("User message..."); // test ok.

◆ test_class_

#define test_class_ (   class_name)

#include <xtd.tunit/include/xtd/tunit/test_class_attribute.h>

Value:
class_name;\
xtd::tunit::test_class_attribute<class_name> __##class_name##_attribute {#class_name}; \
class class_name : public xtd::tunit::test_class
Represents a test class.
Definition: test_class.h:39

Helper to create a test_class in a test unit.

Parameters
class_nameThe test class to add to unit test.
Examples
The following example shows how to use test_class_ helper.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
// The class test must be declared with test_class_ helper.
class test_class_(test) {
public:
// This method is the method that is called just before the start of all tests. It is called only once.
static void class_initialize_(class_initialize) {
}
// This method is the method that is called just after all the tests are finished. It is called only once.
static void class_cleanup_(class_cleanup) {
}
// This method is the method that is called just before a test method starts. It is called for each test.
static void test_initialize_(test_initialize) {
}
// This method is the method that is called right after a test method is finished. It is called for each test.
static void test_cleanup_(test_cleanup) {
}
void test_method_(test_case1) {
}
void test_method_(test_case2) {
}
void ignore_test_method_(test_case3) {
}
};
}
auto main()->int {
return console_unit_test().run();
}
// This code can produce the following output:
//
// Start 3 tests from 1 test case
// Run tests:
// SUCCEED test.test_case1 (0 ms total)
// SUCCEED test.test_case2 (0 ms total)
// IGNORED test.test_case3 (0 ms total)
// Test ignored
//
// Test results:
// SUCCEED 2 tests.
// IGNORED 1 test.
// End 3 tests from 1 test case ran. (0 ms total)

◆ test_class_from_

#define test_class_from_ (   class_name,
  from_class_name 
)

#include <xtd.tunit/include/xtd/tunit/test_class_attribute.h>

Value:
class_name;\
xtd::tunit::test_class_attribute<class_name> __##class_name##_attribute {#class_name}; \
class class_name : public from_class_name

Helper to create a test_class in a test unit from a specified class base.

Parameters
class_nameThe name of the test class.
Examples
The following code show how to create a test class derived_class inherited from base_class :
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
test_class_(base_class) {
public:
void test_method_(test1) {
// Do test...
}
};
test_class_from_(derived_class, base_class) {
public:
void test_method_(test2) {
// Do test...
}
};
}
auto main()->int {
return console_unit_test().run();
}

◆ test_cleanup_

#define test_cleanup_ (   method_name)

#include <xtd.tunit/include/xtd/tunit/test_cleanup_attribute.h>

Value:
__##method_name##_unused() = delete; \
class __test_cleanup_attribute : public xtd::tunit::test_cleanup_attribute { \
public:\
template<typename test_class> __test_cleanup_attribute(test_class& test) : test_cleanup_attribute(#method_name, test, &test_class::method_name, {__FILE__, __LINE__, __func__}) {} \
} __test_cleanup_attribute {*this}; \
static void method_name()
Represents a test cleanup attribute.
Definition: test_cleanup_attribute.h:21

Helper to create a test cleanup method in a test class.

Parameters
method_nameThe test cleanup method to add.
Examples
The following example shows how to use test_cleanup_ helper.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
// The class test must be declared with test_class_ helper.
class test_class_(test) {
public:
// This method is the method that is called just before the start of all tests. It is called only once.
static void class_initialize_(class_initialize) {
}
// This method is the method that is called just after all the tests are finished. It is called only once.
static void class_cleanup_(class_cleanup) {
}
// This method is the method that is called just before a test method starts. It is called for each test.
static void test_initialize_(test_initialize) {
}
// This method is the method that is called right after a test method is finished. It is called for each test.
static void test_cleanup_(test_cleanup) {
}
void test_method_(test_case1) {
}
void test_method_(test_case2) {
}
void ignore_test_method_(test_case3) {
}
};
}
auto main()->int {
return console_unit_test().run();
}
// This code can produce the following output:
//
// Start 3 tests from 1 test case
// Run tests:
// SUCCEED test.test_case1 (0 ms total)
// SUCCEED test.test_case2 (0 ms total)
// IGNORED test.test_case3 (0 ms total)
// Test ignored
//
// Test results:
// SUCCEED 2 tests.
// IGNORED 1 test.
// End 3 tests from 1 test case ran. (0 ms total)
Examples:
test_class.cpp.

◆ test_initialize_

#define test_initialize_ (   method_name)

#include <xtd.tunit/include/xtd/tunit/test_initialize_attribute.h>

Value:
__##method_name##_unused() = delete; \
class __test_initialize_attribute : public xtd::tunit::test_initialize_attribute { \
public:\
template<typename test_class> __test_initialize_attribute(test_class& test) : test_initialize_attribute(#method_name, test, &test_class::method_name, {__FILE__, __LINE__, __func__}) {} \
} __test_initialize_attribute {*this}; \
static void method_name()
Represents a test initialize attribute.
Definition: test_initialize_attribute.h:16

Helper to create a test initialize method in a test class.

Parameters
method_nameThe name of the test initialize method.
Examples
The following example shows how to use test_initialize_ helper.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
// The class test must be declared with test_class_ helper.
class test_class_(test) {
public:
// This method is the method that is called just before the start of all tests. It is called only once.
static void class_initialize_(class_initialize) {
}
// This method is the method that is called just after all the tests are finished. It is called only once.
static void class_cleanup_(class_cleanup) {
}
// This method is the method that is called just before a test method starts. It is called for each test.
static void test_initialize_(test_initialize) {
}
// This method is the method that is called right after a test method is finished. It is called for each test.
static void test_cleanup_(test_cleanup) {
}
void test_method_(test_case1) {
}
void test_method_(test_case2) {
}
void ignore_test_method_(test_case3) {
}
};
}
auto main()->int {
return console_unit_test().run();
}
// This code can produce the following output:
//
// Start 3 tests from 1 test case
// Run tests:
// SUCCEED test.test_case1 (0 ms total)
// SUCCEED test.test_case2 (0 ms total)
// IGNORED test.test_case3 (0 ms total)
// Test ignored
//
// Test results:
// SUCCEED 2 tests.
// IGNORED 1 test.
// End 3 tests from 1 test case ran. (0 ms total)
Examples:
test_class.cpp.

◆ test_method_

#define test_method_ (   method_name)

#include <xtd.tunit/include/xtd/tunit/test_method_attribute.h>

Value:
__##method_name##_unused() = delete; \
class __##method_name##_attribute##_class : public xtd::tunit::test_method_attribute { \
public:\
template<typename test_class> __##method_name##_attribute##_class(test_class& test) : test_method_attribute(#method_name, test, &test_class::method_name, {__FILE__, __LINE__, __func__}) {} \
} __##method_name##_attribute {*this}; \
void method_name()
Represents a test method attribute.
Definition: test_method_attribute.h:22

Add test method to class test.

Parameters
method_nameThe test method to add.
Library
xtd.tunit
Examples
The following example shows how to use test_method_ helper.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
// The class test must be declared with test_class_ helper.
class test_class_(test) {
public:
// This method is the method that is called just before the start of all tests. It is called only once.
static void class_initialize_(class_initialize) {
}
// This method is the method that is called just after all the tests are finished. It is called only once.
static void class_cleanup_(class_cleanup) {
}
// This method is the method that is called just before a test method starts. It is called for each test.
static void test_initialize_(test_initialize) {
}
// This method is the method that is called right after a test method is finished. It is called for each test.
static void test_cleanup_(test_cleanup) {
}
void test_method_(test_case1) {
}
void test_method_(test_case2) {
}
void ignore_test_method_(test_case3) {
}
};
}
auto main()->int {
return console_unit_test().run();
}
// This code can produce the following output:
//
// Start 3 tests from 1 test case
// Run tests:
// SUCCEED test.test_case1 (0 ms total)
// SUCCEED test.test_case2 (0 ms total)
// IGNORED test.test_case3 (0 ms total)
// Test ignored
//
// Test results:
// SUCCEED 2 tests.
// IGNORED 1 test.
// End 3 tests from 1 test case ran. (0 ms total)
Examples:
assert.cpp, assert_abort.cpp, assert_are_equal.cpp, assert_are_equal_with_tolerance.cpp, assert_are_not_equal.cpp, assert_are_not_same.cpp, assert_are_same.cpp, assert_contains.cpp, assert_does_not_throw.cpp, assert_fail.cpp, assert_ignore.cpp, assert_is_empty.cpp, assert_is_false.cpp, assert_is_greater.cpp, assert_is_greater_or_equal.cpp, assert_is_instance_of.cpp, assert_is_less.cpp, assert_is_less_or_equal.cpp, assert_is_NaN.cpp, assert_is_negative.cpp, assert_is_not_empty.cpp, assert_is_not_instance_of.cpp, assert_is_not_null.cpp, assert_is_not_zero.cpp, assert_is_null.cpp, assert_is_positive.cpp, assert_is_true.cpp, assert_is_zero.cpp, assert_succeed.cpp, assert_throws.cpp, assert_throws_any.cpp, assume.cpp, assume_are_equal.cpp, assume_are_equal_with_tolerance.cpp, assume_are_not_equal.cpp, assume_are_not_same.cpp, assume_are_same.cpp, assume_contains.cpp, assume_does_not_throw.cpp, assume_is_empty.cpp, assume_is_false.cpp, assume_is_greater.cpp, assume_is_greater_or_equal.cpp, assume_is_instance_of.cpp, assume_is_less.cpp, assume_is_less_or_equal.cpp, assume_is_NaN.cpp, assume_is_negative.cpp, assume_is_not_empty.cpp, assume_is_not_instance_of.cpp, assume_is_not_null.cpp, assume_is_not_zero.cpp, assume_is_null.cpp, assume_is_positive.cpp, assume_is_true.cpp, assume_is_zero.cpp, assume_throws.cpp, assume_throws_any.cpp, class_with_insert_stream_operator.cpp, class_without_insert_stream_operator.cpp, collection_assert.cpp, collection_assert_all_items_are_instances_of.cpp, collection_assert_all_items_are_not_null.cpp, collection_assert_all_items_are_unique.cpp, collection_assert_are_equal.cpp, collection_assert_are_equivalent.cpp, collection_assert_are_not_equal.cpp, collection_assert_are_not_equivalent.cpp, collection_assert_contains.cpp, collection_assert_does_not_contain.cpp, collection_assert_is_empty.cpp, collection_assert_is_not_empty.cpp, collection_assert_is_ordered.cpp, collection_assume.cpp, collection_assume_all_items_are_instances_of.cpp, collection_assume_all_items_are_not_null.cpp, collection_assume_all_items_are_unique.cpp, collection_assume_are_equal.cpp, collection_assume_are_equivalent.cpp, collection_assume_are_not_equal.cpp, collection_assume_are_not_equivalent.cpp, collection_assume_contains.cpp, collection_assume_does_not_contain.cpp, collection_assume_is_empty.cpp, collection_assume_is_not_empty.cpp, collection_assume_is_ordered.cpp, collection_valid.cpp, collection_valid_all_items_are_instances_of.cpp, collection_valid_all_items_are_not_null.cpp, collection_valid_all_items_are_unique.cpp, collection_valid_are_equal.cpp, collection_valid_are_equivalent.cpp, collection_valid_are_not_equal.cpp, collection_valid_are_not_equivalent.cpp, collection_valid_contains.cpp, collection_valid_does_not_contain.cpp, collection_valid_is_empty.cpp, collection_valid_is_not_empty.cpp, collection_valid_is_ordered.cpp, console_unit_test.cpp, create_gtest_like_event_listener.cpp, directory_assert.cpp, directory_assert_are_equal.cpp, directory_assert_are_not_equal.cpp, directory_assert_does_not_exist.cpp, directory_assert_exists.cpp, directory_assume.cpp, directory_assume_are_equal.cpp, directory_assume_are_not_equal.cpp, directory_assume_does_not_exist.cpp, directory_assume_exists.cpp, directory_valid.cpp, directory_valid_are_equal.cpp, directory_valid_are_not_equal.cpp, directory_valid_does_not_exist.cpp, directory_valid_exists.cpp, file_assert.cpp, file_assert_are_equal.cpp, file_assert_are_not_equal.cpp, file_assert_does_not_exist.cpp, file_assert_exists.cpp, file_assume.cpp, file_assume_are_equal.cpp, file_assume_are_not_equal.cpp, file_assume_does_not_exist.cpp, file_assume_exists.cpp, file_valid.cpp, file_valid_are_equal.cpp, file_valid_are_not_equal.cpp, file_valid_does_not_exist.cpp, file_valid_exists.cpp, generic_test_class.cpp, hello_world_tunit.cpp, many_asserts.cpp, many_valids_and_asserts.cpp, math_assert.cpp, math_assume.cpp, math_valid.cpp, ostream_unit_test.cpp, string_assert.cpp, string_assert_are_equal_ignoring_case.cpp, string_assert_are_not_equal_ignoring_case.cpp, string_assert_contains.cpp, string_assert_does_not_contain.cpp, string_assert_does_not_end_with.cpp, string_assert_does_not_match.cpp, string_assert_does_not_start_with.cpp, string_assert_ends_with.cpp, string_assert_matches.cpp, string_assert_starts_with.cpp, string_assume.cpp, string_assume_are_equal_ignoring_case.cpp, string_assume_are_not_equal_ignoring_case.cpp, string_assume_contains.cpp, string_assume_does_not_contain.cpp, string_assume_does_not_end_with.cpp, string_assume_does_not_match.cpp, string_assume_does_not_start_with.cpp, string_assume_ends_with.cpp, string_assume_matches.cpp, string_assume_starts_with.cpp, string_valid.cpp, string_valid_are_equal_ignoring_case.cpp, string_valid_are_not_equal_ignoring_case.cpp, string_valid_contains.cpp, string_valid_does_not_contain.cpp, string_valid_does_not_end_with.cpp, string_valid_does_not_match.cpp, string_valid_does_not_start_with.cpp, string_valid_ends_with.cpp, string_valid_matches.cpp, string_valid_starts_with.cpp, test_class.cpp, tunit_config_main.cpp, valid.cpp, valid_are_equal.cpp, valid_are_equal_with_tolerance.cpp, valid_are_not_equal.cpp, valid_are_not_same.cpp, valid_are_same.cpp, valid_contains.cpp, valid_does_not_throw.cpp, valid_is_empty.cpp, valid_is_false.cpp, valid_is_greater.cpp, valid_is_greater_or_equal.cpp, valid_is_instance_of.cpp, valid_is_less.cpp, valid_is_less_or_equal.cpp, valid_is_NaN.cpp, valid_is_negative.cpp, valid_is_not_empty.cpp, valid_is_not_instance_of.cpp, valid_is_not_null.cpp, valid_is_not_zero.cpp, valid_is_null.cpp, valid_is_positive.cpp, valid_is_true.cpp, valid_is_zero.cpp, valid_throws.cpp, and valid_throws_any.cpp.

◆ throws_

#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.

Template Parameters
exception_tThe exception type that must be throw.
Parameters
statementThe statement that verify.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
xtd::tunit::assert::throws_(std::out_of_range, [&] {v1.at(5);}); // test ok.
xtd::tunit::assert::throws_(std::out_of_range, [&] {v1.at(2);}, "User message..."); // test error.
xtd::tunit::assume::throws_(std::out_of_range, [&] {v1.at(5);}); // test ok.
xtd::tunit::assume::throws_(std::out_of_range, [&] {v1.at(2);}, "User message..."); // test error.
xtd::tunit::valid::throws_(std::out_of_range, [&] {v1.at(5);}); // test ok.
xtd::tunit::valid::throws_(std::out_of_range, [&] {v1.at(2);}, "User message..."); // test error.

◆ throws_any_

#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.

Parameters
statementThe statement that verify.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
xtd::tunit::assert::throws_any_([&] {v1.at(5);}); // test ok.
xtd::tunit::assert::throws_any_([&] {v1.at(2);}, "User message..."); // test error.
xtd::tunit::assume::throws_any_([&] {v1.at(5);}); // test ok.
xtd::tunit::assume::throws_any_([&] {v1.at(2);}, "User message..."); // test error.
xtd::tunit::valid::throws_any_([&] {v1.at(5);}); // test ok.
xtd::tunit::valid::throws_any_([&] {v1.at(2);}, "User message..."); // test error.

◆ tunit_main_

#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.

Library
xtd.tunit
Remarks
The tunit_main_ contains a main method and launch xtd::tunit::console_unit_test::run.
Examples
The followng code shows ho to use tunit_main_.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
test_class_(class_to_test) {
public:
void test_method_(test1) {
// Do test...
}
};
}
startup_(tunit_main_::main);

◆ tunit_main_with_gtest_compatibility_

#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.

Library
xtd.tunit
Remarks
The tunit_main_ contains main method, launch xtd::tunit::console_unit_test::run and set xtd::tunit::settings::gtest_compatibility to true.
Examples
The followng code shows ho to use tunit_main_with_gtest_compatibility_.
#include <xtd/xtd.tunit>
using namespace xtd::tunit;
namespace unit_tests {
test_class_(class_to_test) {
public:
void test_method_(test1) {
// Do test...
}
};
}
startup_(tunit_main_with_gtest_compatibility_::main);

Enumeration Type Documentation

◆ test_state

#include <xtd.tunit/include/xtd/tunit/test_state.h>

Represent the test state enumeration used bu test.

Namespace
xtd::tunit
Library
xtd.tunit
Enumerator
considered 

Test is considered.

ignored 

Test is ignored.