8#include <xtd/diagnostics/stack_frame>
9#include <xtd/date_time>
32 enum class test_status {
109 std::function<
void()>
method() const noexcept;
125 static
intptr __internal_tunit_unit_tests_mode__;
130 friend class
xtd::
tunit::base_assert;
131 friend class
xtd::
tunit::test_class;
133 static
test& current_test();
134 static const test_class& current_test_class();
135 static const
unit_test& current_unit_test();
136 static
bool has_current_test();
137 static
bool has_current_test_class();
138 static
bool has_current_unit_test();
143 static
test* current_test_;
144 static const test_class* current_test_class_;
145 static const
unit_test* current_unit_test_;
149 xtd::
string message_;
150 std::function<
void()> method_;
154 xtd::
string user_message_;
Contains xtd::tunit::assert_error exception.
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:85
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.hpp:48
static stack_frame current(const xtd::diagnostics::source_location &value=xtd::diagnostics::source_location::current()) noexcept
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Represents a time interval.
Definition time_span.hpp:29
Represents a test class.
Definition test_class.hpp:39
bool not_started() const noexcept
Get a value that represent a not started test.
bool aborted() const noexcept
Gets a value that represent an aborted test.
const xtd::string & expect() const noexcept
Gets the expect value string.
test(const xtd::string &name, const std::function< void()> &method, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) noexcept
Creates a new test instance with specified name, method and stack frame.
xtd::time_span elapsed_time() const noexcept
Gets the elapsed time of the test method.
const xtd::string & message() const noexcept
Gets the message.
const xtd::string & user_message() const noexcept
Gets the user message.
const xtd::date_time & start_time() const noexcept
Gets the start time of the test method.
bool ignored() const noexcept
Get a value that represent an ignored test.
const xtd::string & name() const noexcept
Gets the name of the test method.
bool succeed() const noexcept
Gets a value that represent an succeed test.
std::function< void()> method() const noexcept
Gets the test method.
const xtd::string & actual() const noexcept
Gets the actual value string.
const xtd::diagnostics::stack_frame stack_frame() const noexcept
Gets the stack frame of the test method.
test()=default
Creates a new test instance.
bool failed() const noexcept
Gest a value that represent an failed test.
The unit_test class is unit test base interface.
Definition unit_test.hpp:29
The valid class contains a collection of static methods that implement the most common assertions use...
Definition valid.hpp:22
#define tunit_export_
Define shared library export.
Definition tunit_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
null_ptr null
Represents a null pointer value.
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The tunit namespace contains a unit test library.
Definition abort_error.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains tunit_export_ keyword.
Contains xtd::tunit::assert class.