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<
class value_t>
157 template<
class value_t>
163 template<
class collection_t>
178 template<
class value_a_t,
class value_b_t>
179 static bool equals(
const value_a_t& value_a,
const value_b_t& value_b) {
180 return value_a == value_b;
186 template<
class char_t>
187 static bool equals(
const char_t* value_a,
const string& value_b) {
194 template<
class char_t>
195 static bool equals(
const string& value_a,
const char_t* value_b) {
202 static bool equals(
long double value_a,
long double value_b) {
203 return equals(value_a, value_b, 0.0001l);
209 static bool equals(
double value_a,
double value_b) {
210 return equals(value_a, value_b, 0.0001);
216 static bool equals(
float value_a,
float value_b) {
217 return equals(value_a, value_b, 0.0001f);
224 static bool equals(
double value_a,
double value_b,
double tolerance) {
232 static bool equals(
long double value_a,
long double value_b,
long double tolerance) {
240 static bool equals(
float value_a,
float value_b,
float tolerance) {
Contains std::basic_ostream<char_t, char_traits_t>& operator <<(std::basic_ostream<char_t,...
Contains__tunit_join__items functions.
Contains xtd::tunit::abort_error exception.
Contains xtd::tunit::assert_error exception.
static bool is_attached()
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: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.
static xtd::target_type target_type() noexcept
Gets an xtd::target_type object that contains the current target identifier.
Definition environment.hpp:474
static xtd::compiler compiler_version() noexcept
Gets an xtd::compiler object that contains the current compiler identifier and version number.
Definition environment.hpp:360
static decimal abs(decimal value)
Returns the absolute value of a decimal number.
static xtd::byte max(xtd::byte a, xtd::byte b) noexcept
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 xtd::string join_items(const collection_t &collection)
Join specified collection into xtd::string.
Definition base_assert.hpp:164
static xtd::string join_items(const xtd::string &str)
Join specified string into xtd::string.
static void ignore(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Ignore current test. This is used by the other assert functions.
static void succeed(const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Generates a success with a generic message. This is used by the other assert functions.
static bool equals(double value_a, double value_b, double tolerance)
Determines if specified values are equal with tolerance.
Definition base_assert.hpp:224
static void 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())
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
Definition base_assert.hpp:139
static bool equals(float value_a, float value_b, float tolerance)
Determines if specified values are equal with tolerance.
Definition base_assert.hpp:240
static void ignore(const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Ignore current test. This is used by the other assert functions.
static xtd::string to_string(const value_t *value)
Convert specified value to xtd::string.
Definition base_assert.hpp:158
static void error()
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static void error(const xtd::string &message)
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static void 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())
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static void fail(const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static void abort(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Abort current test. This is used by the other assert functions.
static void fail(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Throws an xtd::tunit::assert_error exception. This is used by the other assert functions.
static void succeed(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Generates a success with a generic message. This is used by the other assert functions.
static bool equals(const string &value_a, const char_t *value_b)
Determines if specified values are equal.
Definition base_assert.hpp:195
static bool equals(const value_a_t &value_a, const value_b_t &value_b)
Determines if specified values are equal.
Definition base_assert.hpp:179
static bool equals(double value_a, double value_b)
Determines if specified values are equal.
Definition base_assert.hpp:209
static xtd::string to_string(const value_t &value)
Convert specified value to xtd::string.
Definition base_assert.hpp:153
static void abort(const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Abort current test. This is used by the other assert functions.
static bool equals(const char_t *value_a, const string &value_b)
Determines if specified values are equal.
Definition base_assert.hpp:187
static bool equals(float value_a, float value_b)
Determines if specified values are equal.
Definition base_assert.hpp:216
static bool equals(long double value_a, long double value_b, long double tolerance)
Determines if specified values are equal with tolerance.
Definition base_assert.hpp:232
static bool equals(long double value_a, long double value_b)
Determines if specified values are equal.
Definition base_assert.hpp:202
static xtd::tunit::settings & default_settings() noexcept
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:37
#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.