xtd 0.2.0
Loading...
Searching...
No Matches

◆ test_class_from_

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

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();
}
The console_unit_test class is console unit test interface.
Definition console_unit_test.h:23
int32 run() noexcept
Runs all tests in this unit_test object and prints the result.
#define test_class_(class_name)
Helper to create a test_class in a test unit.
Definition test_class_attribute.h:43
#define test_method_(method_name)
Add test method to class test.
Definition test_method_attribute.h:89
#define test_class_from_(class_name, from_class_name)
Helper to create a test_class in a test unit from a specified class base.
Definition test_class_attribute.h:78
The tunit namespace contains a unit test library.
Definition abort_error.h:10