xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.tunit
include
xtd
tunit
test_initialize_attribute.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include <xtd/diagnostics/stack_frame>
6
#include <xtd/string>
7
9
namespace
xtd
{
11
namespace
tunit
{
17
class
test_initialize_attribute
{
18
public
:
20
27
template
<
typename
test_
class
_t>
28
test_initialize_attribute
(
const
xtd::string
& name, test_class_t&
test_class
,
void
(*method)(),
const
xtd::diagnostics::stack_frame
& stack_frame =
xtd::diagnostics::stack_frame::current
()) noexcept {
test_class
.
add_test_initialize
({name, method, stack_frame});}
30
};
31
}
32
}
33
40
#define test_initialize_(method_name) \
41
__##method_name##_unused() = delete; \
42
struct __test_initialize_attribute : xtd::tunit::test_initialize_attribute { \
43
template<typename test_class> __test_initialize_attribute(test_class& test) : test_initialize_attribute(#method_name, test, &test_class::method_name) {} \
44
} __test_initialize_attribute {*this}; \
45
static void method_name()
46
xtd::diagnostics::stack_frame
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition
stack_frame.hpp:46
xtd::diagnostics::stack_frame::current
static auto current(const xtd::diagnostics::source_location &value=xtd::diagnostics::source_location::current()) noexcept -> xtd::diagnostics::stack_frame
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
xtd::tunit::test_class
Represents a test class.
Definition
test_class.hpp:39
xtd::tunit::test_class::add_test_initialize
auto add_test_initialize(const xtd::tunit::test &test_initialize) noexcept -> void
Adds the test initialize method.
xtd::tunit::test_initialize_attribute::test_initialize_attribute
test_initialize_attribute(const xtd::string &name, test_class_t &test_class, void(*method)(), const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) noexcept
Creates a new instance of test_initialize_attribute with specified name, test_class and method.
Definition
test_initialize_attribute.hpp:28
xtd::string
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition
__string_definitions.hpp:43
xtd::tunit
The tunit namespace contains a unit test library.
Definition
abort_error.hpp:10
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
Generated on
for xtd by
Gammasoft
. All rights reserved.