6#define __XTD_TUNIT_INTERNAL__
9#define __XTD_TUNIT_INTERNAL__
14#include <xtd/environment>
20#include <xtd/diagnostics/assert>
21#include <xtd/diagnostics/stack_frame>
152 template<
typename value_t>
157 template<
typename value_t>
163 template<
typename collection_t>
178 template<
typename value_a_t,
typename value_b_t>
179 [[nodiscard]]
static auto equals(
const value_a_t& value_a,
const value_b_t& value_b) ->
bool {
180 return value_a == value_b;
186 template<
typename char_t>
187 [[nodiscard]]
static auto equals(
const char_t* value_a,
const string& value_b) ->
bool {
194 template<
typename char_t>
195 [[nodiscard]]
static auto equals(
const string& value_a,
const char_t* value_b) ->
bool {
202 [[nodiscard]]
static auto equals(
long double value_a,
long double value_b) ->
bool {
203 return equals(value_a, value_b, 0.0001l);
209 [[nodiscard]]
static auto equals(
double value_a,
double value_b) ->
bool {
210 return equals(value_a, value_b, 0.0001);
216 [[nodiscard]]
static auto equals(
float value_a,
float value_b) ->
bool {
217 return equals(value_a, value_b, 0.0001f);
224 [[nodiscard]]
static auto equals(
double value_a,
double value_b,
double tolerance) ->
bool {
232 [[nodiscard]]
static auto equals(
long double value_a,
long double value_b,
long double tolerance) ->
bool {
240 [[nodiscard]]
static auto equals(
float value_a,
float value_b,
float tolerance) ->
bool {
Contains xtd::tunit::abort_error exception.
Contains xtd::tunit::assert_error exception.
static auto is_attached() -> bool
Gets a value that indicates whether a debugger is attached to the process.
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.hpp:46
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.
static auto compiler_version() noexcept -> xtd::compiler
Gets an xtd::compiler object that contains the current compiler identifier and version number.
Definition environment.hpp:360
static auto abs(xtd::decimal value) -> xtd::decimal
Returns the absolute value of a decimal number.
static auto max(xtd::byte a, xtd::byte b) noexcept -> xtd::byte
Returns the larger of two 8-bit unsigned integers.
Exception thow when an assertion failed.
Definition assert_error.hpp:17
The base class for assert.
Definition base_assert.hpp:33
static auto fail(const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static auto ignore(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Ignore current test. This is used by the other assert functions.
static auto error() -> void
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static auto to_string(const value_t &value) -> xtd::string
Convert specified value to xtd::string.
Definition base_assert.hpp:153
static auto equals(float value_a, float value_b, float tolerance) -> bool
Determines if specified values are equal with tolerance.
Definition base_assert.hpp:240
static auto abort(const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Abort current test. This is used by the other assert functions.
static auto fail(const xtd::string &actual, const xtd::string &expected, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
Definition base_assert.hpp:139
static auto ignore(const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Ignore current test. This is used by the other assert functions.
static auto to_string(const value_t *value) -> xtd::string
Convert specified value to xtd::string.
Definition base_assert.hpp:158
static auto join_items(const collection_t &collection) -> xtd::string
Join specified collection into xtd::string.
Definition base_assert.hpp:164
static auto equals(long double value_a, long double value_b, long double tolerance) -> bool
Determines if specified values are equal with tolerance.
Definition base_assert.hpp:232
static auto equals(const string &value_a, const char_t *value_b) -> bool
Determines if specified values are equal.
Definition base_assert.hpp:195
static auto succeed(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Generates a success with a generic message. This is used by the other assert functions.
static auto join_items(const xtd::string &str) -> xtd::string
Join specified string into xtd::string.
static auto equals(double value_a, double value_b) -> bool
Determines if specified values are equal.
Definition base_assert.hpp:209
static auto error(const xtd::string &actual, const xtd::string &expected, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static auto fail(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static auto abort(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Abort current test. This is used by the other assert functions.
static auto equals(double value_a, double value_b, double tolerance) -> bool
Determines if specified values are equal with tolerance.
Definition base_assert.hpp:224
static auto succeed(const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Generates a success with a generic message. This is used by the other assert functions.
static auto equals(float value_a, float value_b) -> bool
Determines if specified values are equal.
Definition base_assert.hpp:216
static auto equals(const value_a_t &value_a, const value_b_t &value_b) -> bool
Determines if specified values are equal.
Definition base_assert.hpp:179
static auto equals(const char_t *value_a, const string &value_b) -> bool
Determines if specified values are equal.
Definition base_assert.hpp:187
static auto equals(long double value_a, long double value_b) -> bool
Determines if specified values are equal.
Definition base_assert.hpp:202
static auto error(const xtd::string &message) -> void
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static auto default_settings() noexcept -> xtd::tunit::settings &
Gets default settings instance.
#define debug_break_()
Signals a breakpoint to an attached debugger.
Definition debug_break.hpp:21
#define assert_(...)
Checks for a condition; if the condition is false, displays a message box that shows the call stack.
Definition assert.hpp:25
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.hpp:38
#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
build_type
Identifies the build type.
Definition build_type.hpp:20
@ debug
Build type debug.
Definition build_type.hpp:22
Contains xtd::tunit::ignore_error exception.
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::settings class.