40 template<
typename expected_t,
typename actual_t>
52 template<
typename expected_t,
typename actual_t>
55 assert::are_equal(expected, actual, message, stack_frame);
63#if defined(__xtd__cpp_lib_char8_t)
159 template<
typename expected_t,
typename actual_t>
171 template<
typename expected_t,
typename actual_t>
174 assert::are_not_equal(expected, actual, message, stack_frame);
182#if defined(__xtd__cpp_lib_char8_t)
202 template<
typename expected_t,
typename actual_t>
217 template<
typename expected_t,
typename actual_t>
220 assert::are_not_same(expected, actual, message, stack_frame);
238 template<
typename expected_t,
typename actual_t>
253 template<
typename expected_t,
typename actual_t>
256 assert::are_same(expected, actual, message, stack_frame);
272 template<
typename item_t,
typename collection_t>
285 template<
typename item_t,
typename collection_t>
288 assert::contains(item, collection, message, stack_frame);
295 template<
typename item_t,
typename value_t>
297 template<
typename item_t,
typename value_t>
300 assert::contains(item, values, message, stack_frame);
307#if defined(__xtd__cpp_lib_char8_t)
347 template<
typename value_t>
360 template<
typename value_t>
363 assert::is_empty(value, message, stack_frame);
370 template<
typename value_t>
372 template<
typename value_t>
375 assert::is_empty(values, message, stack_frame);
382#if defined(__xtd__cpp_lib_char8_t)
423 template<
typename value1_t,
typename value2_t>
435 template<
typename value1_t,
typename value2_t>
438 assert::is_greater(val1, val2, message, stack_frame);
446#if defined(__xtd__cpp_lib_char8_t)
464 template<
typename value1_t,
typename value2_t>
477 template<
typename value1_t,
typename value2_t>
480 assert::is_greater_or_equal(val1, val2, message, stack_frame);
488#if defined(__xtd__cpp_lib_char8_t)
505 template<
typename type_t,
typename value_t>
517 template<
typename type_t,
typename value_t>
520 assert::is_instance_of<type_t>(value, message, stack_frame);
535 template<
typename value1_t,
typename value2_t>
547 template<
typename value1_t,
typename value2_t>
550 assert::is_less(val1, val2, message, stack_frame);
558#if defined(__xtd__cpp_lib_char8_t)
576 template<
typename value1_t,
typename value2_t>
589 template<
typename value1_t,
typename value2_t>
592 assert::is_less_or_equal(val1, val2, message, stack_frame);
600#if defined(__xtd__cpp_lib_char8_t)
688 template<
typename value_t>
701 template<
typename value_t>
704 assert::is_negative(value, message, stack_frame);
720 template<
typename value_t>
733 template<
typename value_t>
736 assert::is_not_empty(value, message, stack_frame);
743 template<
typename value_t>
745 template<
typename value_t>
748 assert::is_not_empty(value, message, stack_frame);
755#if defined(__xtd__cpp_lib_char8_t)
772 template<
typename type_t,
typename value_t>
784 template<
typename type_t,
typename value_t>
787 assert::is_not_instance_of<type_t>(value, message, stack_frame);
804 template<
typename po
inter_t>
818 template<
typename po
inter_t>
821 assert::is_not_null(pointer, message, stack_frame);
836 template<
typename optional_t>
849 template<
typename optional_t>
852 assert::is_not_null(opt, message, stack_frame);
867 template<
typename po
inter_t>
880 template<
typename po
inter_t>
883 assert::is_not_null(pointer, message, stack_frame);
898 template<
typename po
inter_t>
911 template<
typename po
inter_t>
914 assert::is_not_null(pointer, message, stack_frame);
931 template<
typename po
inter_t>
946 template<
typename po
inter_t>
978 template<
typename value_t>
991 template<
typename value_t>
994 assert::is_not_zero(value, message, stack_frame);
1011 template<
typename po
inter_t>
1025 template<
typename po
inter_t>
1028 assert::is_null(pointer, message, stack_frame);
1043 template<
typename optional_t>
1056 template<
typename optional_t>
1059 assert::is_null(opt, message, stack_frame);
1074 template<
typename po
inter_t>
1087 template<
typename po
inter_t>
1090 assert::is_null(pointer, message, stack_frame);
1105 template<
typename po
inter_t>
1118 template<
typename po
inter_t>
1121 assert::is_null(pointer, message, stack_frame);
1138 template<
typename po
inter_t>
1153 template<
typename po
inter_t>
1156 assert::is_null(pointer, message, stack_frame);
1191 template<
typename value_t>
1204 template<
typename value_t>
1207 assert::is_positive(value, message, stack_frame);
1247 template<
typename value_t>
1260 template<
typename value_t>
1263 assert::is_zero(value, message, stack_frame);
1279 template<
typename exception_t>
1292 template<
typename exception_t>
1295 assert::throws<exception_t>(statement, message, stack_frame);
Represents text as a sequence of character units.
Definition basic_string.hpp:79
static const basic_string empty_string
Represents the empty basic_string.
Definition basic_string.hpp:124
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.hpp:47
static stack_frame current(const xtd::source_location &value=xtd::source_location::current()) noexcept
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
The base class for assert.
Definition base_assert.hpp:29
The valid class contains a collection of static methods that implement the most common assertions use...
Definition valid.hpp:22
static void are_equal(float expected, float actual, float tolerance, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are equal.
static void is_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that ta condition is zero.
Definition valid.hpp:1248
static void is_null(const xtd::sptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
Definition valid.hpp:1106
static void is_false(bool condition, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that a condition is false.
static void is_true(bool condition, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that a condition is true.
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the first value is greater than the second value.
Definition valid.hpp:436
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the first value is is_less than the second value.
Definition valid.hpp:548
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two objects do refer to different objects.
Definition valid.hpp:239
static void is_negative(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that ta condition is negative.
Definition valid.hpp:689
static void is_null(const xtd::wptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
Definition valid.hpp:1139
static void is_not_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that ta condition is not zero.
Definition valid.hpp:979
static void is_positive(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that ta condition is positive.
Definition valid.hpp:1192
static void is_null(const xtd::uptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
Definition valid.hpp:1075
static void are_equal(float expected, float actual, float tolerance, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are equal.
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are equal.
Definition valid.hpp:41
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the first value is greater than or equal to the second value.
Definition valid.hpp:478
static void is_not_instance_of(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that an object is not of the type supplied or a derived type.
Definition valid.hpp:785
static void is_NaN(long double value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
that a value is NaN.
static void is_not_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that an object is not of the type supplied or a derived type.
Definition valid.hpp:773
static void is_not_null(const xtd::uptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
Definition valid.hpp:868
static void is_not_null(const pointer_t *pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
Definition valid.hpp:819
static void is_not_null(const xtd::uptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
Definition valid.hpp:881
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are equal.
Definition valid.hpp:53
static void is_null(const xtd::wptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
Definition valid.hpp:1154
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the first value is greater than or equal to the second value.
Definition valid.hpp:465
static void is_empty(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that collection contains an item.
Definition valid.hpp:361
static void is_not_null(const xtd::wptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
Definition valid.hpp:932
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two objects do refer to different objects.
Definition valid.hpp:203
static void contains(const item_t &item, const collection_t &collection, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that collection contains an item.
Definition valid.hpp:286
static void is_null(const std::optional< optional_t > &opt, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the optional is std::nullopt.
Definition valid.hpp:1057
static void are_equal(long double expected, long double actual, long double tolerance, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are equal.
static void is_negative(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that ta condition is negative.
Definition valid.hpp:702
static void is_NaN(double value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
that a value is NaN.
static void is_null(std::nullptr_t pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
static void is_not_zero(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that ta condition is not zero.
Definition valid.hpp:992
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the first value is is_less than or equal to the second value.
Definition valid.hpp:577
static void is_not_null(std::nullptr_t pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
static void are_equal(double expected, double actual, double tolerance, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are equal.
static void are_equal(long double expected, long double actual, long double tolerance, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are equal.
static void is_NaN(float value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
that a value is NaN.
static void is_NaN(float value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that a value is NaN.
static void is_not_null(const std::optional< optional_t > &opt, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the optional is not std::nullopt.
Definition valid.hpp:837
static void does_not_throw(const std::function< void()> &statement, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the statement does not throw an exception.
static void is_not_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
static void is_not_null(const std::optional< optional_t > &opt, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the optional is not std::nullopt.
Definition valid.hpp:850
static void contains(const item_t &item, const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that collection contains an item.
Definition valid.hpp:273
static void is_NaN(double value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that a value is NaN.
static void does_not_throw(const std::function< void()> &statement, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the statement does not throw an exception.
static void is_false(bool condition, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that a condition is false.
static void is_null(const xtd::uptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
Definition valid.hpp:1088
static void is_null(const pointer_t *pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
Definition valid.hpp:1026
static void is_zero(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that ta condition is zero.
Definition valid.hpp:1261
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are not equal.
Definition valid.hpp:172
static void is_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that an object is of the type supplied or a derived type.
Definition valid.hpp:506
static void throws_any(const std::function< void()> &statement, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the statement does not throw an exception.
static void is_true(bool condition, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that a condition is true.
static void is_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that collection contains an item.
Definition valid.hpp:348
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the first value is is_less than or equal to the second value.
Definition valid.hpp:590
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the first value is is_less than the second value.
Definition valid.hpp:536
static void is_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
static void is_instance_of(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that an object is of the type supplied or a derived type.
Definition valid.hpp:518
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two objects do refer to different objects.
Definition valid.hpp:254
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are not equal.
Definition valid.hpp:160
static void is_not_null(const xtd::sptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
Definition valid.hpp:899
static void throws_any(const std::function< void()> &statement, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the statement does not throw an exception.
static void is_not_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
Definition valid.hpp:805
static void is_NaN(long double value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that a value is NaN.
static void is_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
Definition valid.hpp:1012
static void is_not_null(const xtd::wptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
Definition valid.hpp:947
static void is_null(const xtd::sptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is null.
Definition valid.hpp:1119
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the first value is greater than the second value.
Definition valid.hpp:424
static void is_not_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that collection does not contain any item.
Definition valid.hpp:721
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two objects do refer to different objects.
Definition valid.hpp:218
static void is_null(const std::optional< optional_t > &opt, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the optional is std::nullopt.
Definition valid.hpp:1044
static void are_equal(double expected, double actual, double tolerance, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that two type are equal.
static void is_not_empty(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that collection does not contain any item.
Definition valid.hpp:734
static void is_not_null(const xtd::sptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that the pointer is not null.
Definition valid.hpp:912
static void is_positive(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Validates that ta condition is positive.
Definition valid.hpp:1205
#define tunit_export_
Define shared library export.
Definition tunit_export.hpp:13
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:27
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
std::weak_ptr< type_t > wptr
The xtd::uptr object is a weak pointer.
Definition wptr.hpp:17
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:26
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::tunit::assert class.