49 template<
typename expected_t,
typename actual_t>
62 template<
typename expected_t,
typename actual_t>
75 template<
typename expected_t,
typename actual_t>
89 template<
typename expected_t,
typename actual_t>
91 if (actual == expected)
94 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
99 if (strcmp(actual, expected) == 0)
102 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
109 base_assert::base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
113 if (std::u16string(actual) == std::u16string(expected))
116 base_assert::base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
120 if (std::u32string(actual) == std::u32string(expected))
123 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
127 if (wcscmp(actual, expected) == 0)
130 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
134 if (std::isnan(actual) && std::isnan(expected))
136 else if (actual == expected)
139 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
143 if (std::isnan(actual) && std::isnan(expected))
145 else if (actual == expected)
148 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
152 if (std::isnan(actual) && std::isnan(expected))
154 else if (actual == expected)
157 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
216 if (fabsf(expected - actual) <= fabsf(tolerance))
219 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
233 static void are_equal(
double expected,
double actual,
double tolerance) {
are_equal(expected, actual, tolerance,
"",
csf_);}
277 if (fabs(expected - actual) <= fabs(tolerance))
280 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
294 static void are_equal(
long double expected,
long double actual,
long double tolerance) {
are_equal(expected, actual, tolerance,
"",
csf_);}
338 if (fabsl(expected - actual) <= fabsl(tolerance))
341 base_assert::fail(base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
353 template<
typename expected_t,
typename actual_t>
366 template<
typename expected_t,
typename actual_t>
379 template<
typename expected_t,
typename actual_t>
393 template<
typename expected_t,
typename actual_t>
395 if (actual != expected)
398 base_assert::fail(
"not " + base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
403 if (strcmp(actual, expected) != 0)
406 base_assert::fail(
"not " + base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
413 base_assert::fail(
"not " + base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
417 if (std::u16string(actual) != std::u16string(expected))
420 base_assert::fail(
"not " + base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
424 if (std::u32string(actual) != std::u32string(expected))
427 base_assert::fail(
"not " + base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
431 if (wcscmp(actual, expected) != 0)
434 base_assert::fail(
"not " + base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
450 template<
typename expected_t,
typename actual_t>
466 template<
typename expected_t,
typename actual_t>
482 template<
typename expected_t,
typename actual_t>
499 template<
typename expected_t,
typename actual_t>
501 if (&actual != &expected)
504 base_assert::fail(
"not same as " + base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
519 template<
typename expected_t,
typename actual_t>
535 template<
typename expected_t,
typename actual_t>
551 template<
typename expected_t,
typename actual_t>
568 template<
typename expected_t,
typename actual_t>
570 if (&actual == &expected)
573 base_assert::fail(
"same as " + base_assert::to_string(expected), base_assert::to_string(actual), message, stack_frame);
586 template<
typename item_t,
typename collection_t>
600 template<
typename item_t,
typename collection_t>
614 template<
typename item_t,
typename collection_t>
629 template<
typename item_t,
typename collection_t>
631 auto result = std::find(collection.begin(), collection.end(), item);
632 if (result != collection.end())
635 base_assert::fail(
"collection containing " + base_assert::to_string(item), base_assert::join_items(collection), message, stack_frame);
639 template<
typename item_t,
typename value_t>
641 template<
typename item_t,
typename value_t>
643 template<
typename item_t,
typename value_t>
645 template<
typename item_t,
typename value_t>
647 auto result = std::find(values.begin(), values.end(), item);
648 if (result != values.end())
651 base_assert::fail(
"collection containing " + base_assert::to_string(item), base_assert::join_items(values), message, stack_frame);
656 auto result = std::find(
s.begin(),
s.end(), item);
657 if (result !=
s.end())
660 base_assert::fail(
"collection containing " + base_assert::to_string(item), base_assert::join_items(s), message, stack_frame);
664 std::u8string
s(values);
665 auto result = std::find(
s.begin(),
s.end(), item);
666 if (result !=
s.end())
669 base_assert::fail(
"collection containing " + base_assert::to_string(item), base_assert::join_items(s), message, stack_frame);
673 std::u16string
s(values);
674 auto result = std::find(
s.begin(),
s.end(), item);
675 if (result !=
s.end())
678 base_assert::fail(
"collection containing " + base_assert::to_string(item), base_assert::join_items(s), message, stack_frame);
682 std::u32string
s(values);
683 auto result = std::find(
s.begin(),
s.end(), item);
684 if (result !=
s.end())
687 base_assert::fail(
"collection containing " + base_assert::to_string(item), base_assert::join_items(s), message, stack_frame);
691 std::wstring
s(values);
692 auto result = std::find(
s.begin(),
s.end(), item);
693 if (result !=
s.end())
696 base_assert::fail(
"collection containing " + base_assert::to_string(item), base_assert::join_items(s), message, stack_frame);
750 }
catch (
const std::exception&
e) {
751 base_assert::fail(
"No Exception to be thrown",
"<" + __tunit_demangle(
typeid(
e).name()) +
">", message, stack_frame);
753 base_assert::fail(
"No Exception to be thrown",
"<exception>", message, stack_frame);
767 template<
typename value_t>
781 template<
typename value_t>
795 template<
typename value_t>
810 template<
typename value_t>
812 if (std::empty(value))
815 base_assert::fail(
"collection <empty>", base_assert::join_items(value), message, stack_frame);
819 template<
typename value_t>
821 template<
typename value_t>
823 template<
typename value_t>
825 template<
typename value_t>
827 if (std::empty(values))
830 base_assert::fail(
"collection <empty>", base_assert::join_items(values), message, stack_frame);
838 base_assert::fail(
"collection <empty>", base_assert::join_items(s), message, stack_frame);
846 base_assert::fail(
"collection <empty>", base_assert::join_items(s), message, stack_frame);
854 base_assert::fail(
"collection <empty>", base_assert::join_items(s), message, stack_frame);
862 base_assert::fail(
"collection <empty>", base_assert::join_items(s), message, stack_frame);
870 base_assert::fail(
"collection <empty>", base_assert::join_items(s), message, stack_frame);
925 if (condition ==
false)
940 template<
typename value1_t,
typename value2_t>
953 template<
typename value1_t,
typename value2_t>
966 template<
typename value1_t,
typename value2_t>
980 template<
typename value1_t,
typename value2_t>
985 base_assert::fail(
"greater than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
990 if (strcmp(val1, val2) > 0)
993 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1000 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1004 if (std::u16string(val1) > std::u16string(val2))
1005 succeed(message, stack_frame);
1007 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1011 if (std::u32string(val1) > std::u32string(val2))
1012 succeed(message, stack_frame);
1014 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1018 if (wcscmp(val1, val2) > 0)
1019 succeed(message, stack_frame);
1021 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1035 template<
typename value1_t,
typename value2_t>
1049 template<
typename value1_t,
typename value2_t>
1063 template<
typename value1_t,
typename value2_t>
1078 template<
typename value1_t,
typename value2_t>
1081 succeed(message, stack_frame);
1083 base_assert::fail(
"greater than or equal to " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1088 if (strcmp(val1, val2) >= 0)
1089 succeed(message, stack_frame);
1091 base_assert::fail(
"greather than or equal to " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1096 succeed(message, stack_frame);
1098 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1102 if (std::u16string(val1) >= std::u16string(val2))
1103 succeed(message, stack_frame);
1105 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1109 if (std::u32string(val1) >= std::u32string(val2))
1110 succeed(message, stack_frame);
1112 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1116 if (wcscmp(val1, val2) >= 0)
1117 succeed(message, stack_frame);
1119 base_assert::fail(
"greather than or equal to " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1132 template<
typename type_t,
typename value_t>
1145 template<
typename type_t,
typename value_t>
1158 template<
typename type_t,
typename value_t>
1172 template<
typename type_t,
typename value_t>
1174 const type_t* instance =
dynamic_cast<const type_t*
>(&value);
1175 if (instance !=
nullptr)
1176 succeed(message, stack_frame);
1178 base_assert::fail(
"instance of <" + __tunit_demangle(
typeid(type_t).name()) +
">",
"<" + __tunit_demangle(
typeid(value).name()) +
">", message, stack_frame);
1190 template<
typename value1_t,
typename value2_t>
1203 template<
typename value1_t,
typename value2_t>
1216 template<
typename value1_t,
typename value2_t>
1230 template<
typename value1_t,
typename value2_t>
1233 succeed(message, stack_frame);
1235 base_assert::fail(
"less than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1241 if (strcmp(val1, val2) < 0)
1242 succeed(message, stack_frame);
1244 base_assert::fail(
"less than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1249 succeed(message, stack_frame);
1251 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1255 if (std::u16string(val1) < std::u16string(val2))
1256 succeed(message, stack_frame);
1258 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1262 if (std::u32string(val1) < std::u32string(val2))
1263 succeed(message, stack_frame);
1265 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1269 if (wcscmp(val1, val2) < 0)
1270 succeed(message, stack_frame);
1272 base_assert::fail(
"less than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1286 template<
typename value1_t,
typename value2_t>
1300 template<
typename value1_t,
typename value2_t>
1314 template<
typename value1_t,
typename value2_t>
1329 template<
typename value1_t,
typename value2_t>
1332 succeed(message, stack_frame);
1334 base_assert::fail(
"less than or equal to " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1339 if (strcmp(val1, val2) <= 0)
1340 succeed(message, stack_frame);
1342 base_assert::fail(
"less than or equal to " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1347 succeed(message, stack_frame);
1349 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1353 if (std::u16string(val1) < std::u16string(val2))
1354 succeed(message, stack_frame);
1356 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1360 if (std::u32string(val1) < std::u32string(val2))
1361 succeed(message, stack_frame);
1363 base_assert::fail(
"greather than " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1367 if (wcscmp(val1, val2) <= 0)
1368 succeed(message, stack_frame);
1370 base_assert::fail(
"less than or equal to " + base_assert::to_string(val2), base_assert::to_string(val1), message, stack_frame);
1425 if (std::isnan(value))
1426 succeed(message, stack_frame);
1482 if (std::isnan(value))
1483 succeed(message, stack_frame);
1539 if (std::isnan(value))
1540 succeed(message, stack_frame);
1555 template<
typename value_t>
1569 template<
typename value_t>
1583 template<
typename value_t>
1598 template<
typename value_t>
1601 succeed(message, stack_frame);
1603 base_assert::fail(
"negative", base_assert::to_string(value), message, stack_frame);
1616 template<
typename value_t>
1630 template<
typename value_t>
1644 template<
typename value_t>
1659 template<
typename value_t>
1661 if (!std::empty(value))
1662 succeed(message, stack_frame);
1668 template<
typename value_t>
1670 template<
typename value_t>
1672 template<
typename value_t>
1674 template<
typename value_t>
1676 if (!std::empty(value))
1677 succeed(message, stack_frame);
1684 succeed(message, stack_frame);
1691 succeed(message, stack_frame);
1698 succeed(message, stack_frame);
1705 succeed(message, stack_frame);
1712 succeed(message, stack_frame);
1727 template<
typename type_t,
typename value_t>
1740 template<
typename type_t,
typename value_t>
1753 template<
typename type_t,
typename value_t>
1767 template<
typename type_t,
typename value_t>
1769 if (
dynamic_cast<const type_t*
>(&value) ==
nullptr)
1770 succeed(message, stack_frame);
1772 base_assert::fail(
"not instance of <" + __tunit_demangle(
typeid(type_t).name()) +
">",
"<" + __tunit_demangle(
typeid(value).name()) +
">", message, stack_frame);
1786 template<
typename po
inter_t>
1801 template<
typename po
inter_t>
1816 template<
typename po
inter_t>
1832 template<
typename po
inter_t>
1834 if (pointer !=
nullptr)
1835 succeed(message, stack_frame);
1850 template<
typename po
inter_t>
1864 template<
typename po
inter_t>
1878 template<
typename po
inter_t>
1893 template<
typename po
inter_t>
1895 if (pointer !=
nullptr)
1896 succeed(message, stack_frame);
1911 template<
typename po
inter_t>
1925 template<
typename po
inter_t>
1939 template<
typename po
inter_t>
1954 template<
typename po
inter_t>
1956 if (pointer !=
nullptr)
1957 succeed(message, stack_frame);
1973 template<
typename po
inter_t>
1988 template<
typename po
inter_t>
2003 template<
typename po
inter_t>
2019 template<
typename po
inter_t>
2076 template<
typename value_t>
2090 template<
typename value_t>
2104 template<
typename value_t>
2119 template<
typename value_t>
2122 succeed(message, stack_frame);
2138 template<
typename po
inter_t>
2153 template<
typename po
inter_t>
2168 template<
typename po
inter_t>
2184 template<
typename po
inter_t>
2186 if (pointer ==
nullptr)
2187 succeed(message, stack_frame);
2202 template<
typename po
inter_t>
2216 template<
typename po
inter_t>
2230 template<
typename po
inter_t>
2245 template<
typename po
inter_t>
2247 if (pointer ==
nullptr)
2248 succeed(message, stack_frame);
2263 template<
typename po
inter_t>
2277 template<
typename po
inter_t>
2291 template<
typename po
inter_t>
2306 template<
typename po
inter_t>
2308 if (pointer ==
nullptr)
2309 succeed(message, stack_frame);
2325 template<
typename po
inter_t>
2340 template<
typename po
inter_t>
2355 template<
typename po
inter_t>
2371 template<
typename po
inter_t>
2428 template<
typename value_t>
2442 template<
typename value_t>
2456 template<
typename value_t>
2471 template<
typename value_t>
2474 succeed(message, stack_frame);
2476 base_assert::fail(
"positive", base_assert::to_string(value), message, stack_frame);
2530 if (condition ==
true)
2531 succeed(message, stack_frame);
2546 template<
typename value_t>
2560 template<
typename value_t>
2574 template<
typename value_t>
2589 template<
typename value_t>
2592 succeed(message, stack_frame);
2607 template<
typename exception_t>
2621 template<
typename exception_t>
2635 template<
typename exception_t>
2650 template<
typename exception_t>
2654 base_assert::fail(
"<" + __tunit_demangle(
typeid(exception_t).name()) +
">",
"<nothing>", message, stack_frame);
2655 }
catch (
const exception_t&) {
2656 succeed(message, stack_frame);
2659 }
catch (
const std::exception&
e) {
2660 base_assert::fail(
"<" + __tunit_demangle(
typeid(exception_t).name()) +
">",
"<" + __tunit_demangle(
typeid(
e).name()) +
">", message, stack_frame);
2662 base_assert::fail(
"<" + __tunit_demangle(
typeid(exception_t).name()) +
">",
"<exception>", message, stack_frame);
2719 succeed(message, stack_frame);
2729 #define __CMD_ASSERT_0_ARGS__(cmd) cmd(csf_)
2730 #define __CMD_ASSERT_1_ARGS__(cmd, arg1) cmd(arg1, csf_)
2731 #define __CMD_ASSERT_2_ARGS__(cmd, arg1, arg2) cmd(arg1, arg2, csf_)
2732 #define __CMD_ASSERT_3_ARGS__(cmd, arg1, arg2, arg3) cmd(arg1, arg2, arg3, csf_)
2733 #define __CMD_ASSERT_4_ARGS__(cmd, arg1, arg2, arg3, arg4) cmd(arg1, arg2, arg3, arg4, csf_)
2734 #define __CMD_ASSERT_5_ARGS__(cmd, arg1, arg2, arg3, arg4) cmd(arg1, arg2, arg3, arg4, arg5, csf_)
2735 #define __GET_LAST_ARG(arg1, arg2, arg3, arg4, arg5, arg6, ...) arg6
2736 #define __CMD_ASSERT_MACRO_CHOOSER(cmd, ...) __GET_LAST_ARG(__VA_ARGS__, __CMD_ASSERT_5_ARGS__, __CMD_ASSERT_4_ARGS__, __CMD_ASSERT_3_ARGS__, __CMD_ASSERT_2_ARGS__, __CMD_ASSERT_1_ARGS__, __CMD_ASSERT_0_ARGS__, )
2737 #define __CMD_ASSERT_ARGS(cmd, ...) __CMD_ASSERT_MACRO_CHOOSER(cmd, __VA_ARGS__)(cmd, __VA_ARGS__)
2740 #define abort_() abort(csf_)
2742 #define are_equal_(...) __CMD_ASSERT_ARGS(are_equal, __VA_ARGS__)
2744 #define are_not_equal_(...) __CMD_ASSERT_ARGS(are_not_equal, __VA_ARGS__)
2746 #define are_not_same_(...) __CMD_ASSERT_ARGS(are_not_same, __VA_ARGS__)
2748 #define are_same_(...) __CMD_ASSERT_ARGS(are_same, __VA_ARGS__)
2750 #define contains_(...) __CMD_ASSERT_ARGS(contains, __VA_ARGS__)
2752 #define does_not_throw_(...) __CMD_ASSERT_ARGS(does_not_throw, __VA_ARGS__)
2754 #define fail_() base_assert::fail(csf_)
2756 #define ignore_() ignore(csf_)
2758 #define is_empty_(...) __CMD_ASSERT_ARGS(is_empty, __VA_ARGS__)
2760 #define is_false_(...) __CMD_ASSERT_ARGS(is_false, __VA_ARGS__)
2762 #define is_greater_(...) __CMD_ASSERT_ARGS(is_greater, __VA_ARGS__)
2764 #define is_greater_or_equal_(...) __CMD_ASSERT_ARGS(is_greater_or_equal, __VA_ARGS__)
2766 #define is_instance_of_(type_t, ...) __CMD_ASSERT_ARGS(is_instance_of<type_t>, __VA_ARGS__)
2768 #define is_less_(...) __CMD_ASSERT_ARGS(is_less, __VA_ARGS__)
2770 #define is_less_or_equal_(...) __CMD_ASSERT_ARGS(is_less_or_equal, __VA_ARGS__)
2772 #define is_NaN_(...) __CMD_ASSERT_ARGS(is_NaN, __VA_ARGS__)
2774 #define is_negative_(...) __CMD_ASSERT_ARGS(is_negative, __VA_ARGS__)
2776 #define is_not_empty_(...) __CMD_ASSERT_ARGS(is_not_empty, __VA_ARGS__)
2778 #define is_not_instance_of_(type_t, ...) __CMD_ASSERT_ARGS(is_not_instance_of<type_t>, __VA_ARGS__)
2780 #define is_not_null_(...) __CMD_ASSERT_ARGS(is_not_null, __VA_ARGS__)
2782 #define is_not_zero_(...) __CMD_ASSERT_ARGS(is_not_zero, __VA_ARGS__)
2784 #define is_null_(...) __CMD_ASSERT_ARGS(is_null, __VA_ARGS__)
2786 #define is_positive_(...) __CMD_ASSERT_ARGS(is_positive, __VA_ARGS__)
2788 #define is_true_(...) __CMD_ASSERT_ARGS(is_true, __VA_ARGS__)
2790 #define is_zero_(...) __CMD_ASSERT_ARGS(is_zero, __VA_ARGS__)
2792 #define succeed_() succeed(csf_)
2794 #define throws_(exception_t, ...) __CMD_ASSERT_ARGS(throws<exception_t>, __VA_ARGS__)
2796 #define throws_any_(...) __CMD_ASSERT_ARGS(throws_any, __VA_ARGS__)
Contains xtd::tunit::assert class.
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:29
static stack_frame empty() noexcept
Return an empty stack frame.
Exception thow when an assertion failed.
Definition: assert_error.h:18
The assert class contains a collection of static methods that implement the most common assertions us...
Definition: assert.h:34
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal.
Definition: assert.h:90
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2246
static void is_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2154
static void is_not_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that ta condition is not zero.
Definition: assert.h:2091
static void are_equal(float expected, float actual, float tolerance)
Asserts that two type are equal.
Definition: assert.h:172
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2278
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the first value is greater than or equal to the second value.
Definition: assert.h:1050
static void is_not_null(std::nullptr_t pointer, const xtd::ustring &message)
Asserts that the pointer is not null.
Definition: assert.h:2052
static void are_not_same(const expected_t &expected, const actual_t &actual)
Asserts that two objects do refer to differents objects.
Definition: assert.h:451
static void is_negative(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that ta condition is negative.
Definition: assert.h:1570
static void is_NaN(double value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that a value is NaN.
Definition: assert.h:1424
static void is_null(const std::shared_ptr< pointer_t > &pointer)
Asserts that the pointer is null.
Definition: assert.h:2264
static void is_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2393
static void is_NaN(long double value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that a value is NaN.
Definition: assert.h:1481
static void is_not_null(std::nullptr_t pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:2064
static void is_null(std::nullptr_t pointer, const xtd::ustring &message)
Asserts that the pointer is null.
Definition: assert.h:2404
static void are_same(const expected_t &expected, const actual_t &actual)
Asserts that two objects do refer to differents objects.
Definition: assert.h:520
static void are_equal(double expected, double actual, double tolerance, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal.
Definition: assert.h:276
static void throws_any(const std::function< void()> &statement, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the staement does not throw an exception.
Definition: assert.h:2712
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:1894
static void is_null(const std::unique_ptr< pointer_t > &pointer)
Asserts that the pointer is null.
Definition: assert.h:2203
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:1955
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message)
Asserts that the pointer is null.
Definition: assert.h:2356
static void is_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that an object is of the type supplied or a derived type.
Definition: assert.h:1146
static void is_null(const std::weak_ptr< pointer_t > &pointer)
Asserts that the pointer is null.
Definition: assert.h:2326
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two objects do refer to differents objects.
Definition: assert.h:500
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the first value is greater than the second value.
Definition: assert.h:954
static void is_not_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:1802
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Asserts that the first value is is_less than or equal to the second value.
Definition: assert.h:1315
static void is_not_zero(const value_t &value, const xtd::ustring &message)
Asserts that ta condition is not zero.
Definition: assert.h:2105
static void is_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains an item.
Definition: assert.h:782
static void is_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that ta condition is zero.
Definition: assert.h:2561
static void is_not_zero(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that ta condition is not zero.
Definition: assert.h:2120
static void is_not_null(const std::unique_ptr< pointer_t > &pointer)
Asserts that the pointer is not null.
Definition: assert.h:1851
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:1989
static void is_null(const pointer_t *pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2185
static void is_null(const pointer_t *pointer, const xtd::ustring &message)
Asserts that the pointer is null.
Definition: assert.h:2169
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Asserts that the first value is greater than or equal to the second value.
Definition: assert.h:1064
static void is_false(bool condition)
Asserts that ta condition is false.
Definition: assert.h:884
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are not equal.
Definition: assert.h:367
static void is_null(std::nullptr_t pointer)
Asserts that the pointer is null.
Definition: assert.h:2382
static void are_equal(float expected, float actual, float tolerance, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal.
Definition: assert.h:215
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two objects do refer to differents objects.
Definition: assert.h:569
static void is_less(const value1_t &val1, const value2_t &val2)
Asserts that the first value is is_less than the second value.
Definition: assert.h:1191
static void is_instance_of(const value_t &value, const xtd::ustring &message)
Asserts that an object is of the type supplied or a derived type.
Definition: assert.h:1159
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2)
Asserts that the first value is greater than or equal to the second value.
Definition: assert.h:1036
static void is_true(bool condition, const xtd::ustring &message)
Asserts that a condition is true.
Definition: assert.h:2515
static void contains(const item_t &item, const collection_t &collection, const xtd::ustring &message)
Asserts that collection contains an item.
Definition: assert.h:615
static void is_not_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:2041
static void is_not_null(const pointer_t *pointer, const xtd::ustring &message)
Asserts that the pointer is not null.
Definition: assert.h:1817
static void is_less_or_equal(const value1_t &val1, const value2_t &val2)
Asserts that the first value is is_less than or equal to the second value.
Definition: assert.h:1287
static void does_not_throw(const std::function< void()> &statement, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the staement does not throw an exception.
Definition: assert.h:721
static void is_zero(const value_t &value, const xtd::ustring &message)
Asserts that ta condition is zero.
Definition: assert.h:2575
static void are_equal(float expected, float actual, float tolerance, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal.
Definition: assert.h:186
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Asserts that the first value is is_less than the second value.
Definition: assert.h:1217
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Asserts that the first value is greater than the second value.
Definition: assert.h:967
static void is_empty(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains an item.
Definition: assert.h:811
static void is_not_instance_of(const value_t &value)
Asserts that an object is not of the type supplied or a derived type.
Definition: assert.h:1728
static void is_instance_of(const value_t &value)
Asserts that an object is of the type supplied or a derived type.
Definition: assert.h:1133
static void is_empty(const value_t &value, const xtd::ustring &message)
Asserts that collection contains an item.
Definition: assert.h:796
static void is_true(bool condition, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that a condition is true.
Definition: assert.h:2502
static void are_equal(long double expected, long double actual, long double tolerance)
Asserts that two type are equal.
Definition: assert.h:294
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the first value is is_less than the second value.
Definition: assert.h:1231
static void is_NaN(double value)
that a value is NaN.
Definition: assert.h:1384
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message)
Asserts that the pointer is not null.
Definition: assert.h:1940
static void is_NaN(long double value, const xtd::diagnostics::stack_frame &stack_frame)
that a value is NaN.
Definition: assert.h:1454
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the first value is is_less than or equal to the second value.
Definition: assert.h:1330
static void are_equal(double expected, double actual, double tolerance, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal.
Definition: assert.h:247
static void is_positive(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that ta condition is positive.
Definition: assert.h:2472
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:1865
static void does_not_throw(const std::function< void()> &statement, const xtd::ustring &message)
Asserts that the staement does not throw an exception.
Definition: assert.h:733
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Asserts that two type are equal.
Definition: assert.h:76
static void is_not_null(std::nullptr_t pointer)
Asserts that the pointer is not null.
Definition: assert.h:2030
static void are_equal(long double expected, long double actual, long double tolerance, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal.
Definition: assert.h:308
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message)
Asserts that the pointer is not null.
Definition: assert.h:1879
static void is_not_zero(const value_t &value)
Asserts that ta condition is not zero.
Definition: assert.h:2077
static void is_false(bool condition, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that a condition is false.
Definition: assert.h:897
static void contains(const item_t &item, const collection_t &collection, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains an item.
Definition: assert.h:630
static void are_equal(long double expected, long double actual, long double tolerance, const xtd::ustring &message)
Asserts that two type are equal.
Definition: assert.h:322
static void are_equal(float expected, float &actual, float tolerance, const xtd::ustring &message)
Asserts that two type are equal.
Definition: assert.h:200
static void is_zero(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that ta condition is zero.
Definition: assert.h:2590
static void is_positive(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that ta condition is positive.
Definition: assert.h:2443
static void does_not_throw(const std::function< void()> &statement, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the staement does not throw an exception.
Definition: assert.h:746
static void is_true(bool condition, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that a condition is true.
Definition: assert.h:2529
static void throws_any(const std::function< void()> &statement)
Asserts that the staement does not throw an exception.
Definition: assert.h:2675
static void is_NaN(float value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that a value is NaN.
Definition: assert.h:1538
static void are_equal(long double expected, long double actual, long double tolerance, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal.
Definition: assert.h:337
static void is_negative(const value_t &value)
Asserts that ta condition is negative.
Definition: assert.h:1556
static void is_positive(const value_t &value, const xtd::ustring &message)
Asserts that ta condition is positive.
Definition: assert.h:2457
static void is_false(bool condition, const xtd::ustring &message)
Asserts that a condition is false.
Definition: assert.h:910
static void is_negative(const value_t &value, const xtd::ustring &message)
Asserts that ta condition is negative.
Definition: assert.h:1584
static void is_empty(const value_t &value)
Asserts that collection contains an item.
Definition: assert.h:768
static void is_not_empty(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection does not contain any item.
Definition: assert.h:1660
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2307
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2341
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the first value is is_less than or equal to the second value.
Definition: assert.h:1301
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message)
Asserts that the pointer is null.
Definition: assert.h:2231
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Asserts that two objects do refer to differents objects.
Definition: assert.h:483
static void is_NaN(float value, const xtd::diagnostics::stack_frame &stack_frame)
that a value is NaN.
Definition: assert.h:1511
static void is_true(bool condition)
Asserts that ta condition is true.
Definition: assert.h:2489
static void is_NaN(long double value)
that a value is NaN.
Definition: assert.h:1441
static void is_NaN(double value, const xtd::ustring &message)
Asserts that a value is NaN.
Definition: assert.h:1410
static void is_not_empty(const value_t &value, const xtd::ustring &message)
Asserts that collection does not contain any item.
Definition: assert.h:1645
static void is_not_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection does not contain any item.
Definition: assert.h:1631
static void does_not_throw(const std::function< void()> &statement)
Asserts that the staement does not throw an exception.
Definition: assert.h:709
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:1926
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the first value is greater than the second value.
Definition: assert.h:981
static void is_NaN(float value, const xtd::ustring &message)
Asserts that a value is NaN.
Definition: assert.h:1524
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2217
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:2020
static void is_not_empty(const value_t &value)
Asserts that collection oes not contain any item.
Definition: assert.h:1617
static void contains(const item_t &item, const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains an item.
Definition: assert.h:601
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal.
Definition: assert.h:63
static void is_not_null(const pointer_t *pointer)
Asserts that the pointer is not null.
Definition: assert.h:1787
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2372
static void is_negative(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that ta condition is negative.
Definition: assert.h:1599
static void is_positive(const value_t &value)
Asserts that ta condition is positive.
Definition: assert.h:2429
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the first value is is_less than the second value.
Definition: assert.h:1204
static void throws_any(const std::function< void()> &statement, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the staement does not throw an exception.
Definition: assert.h:2687
static void is_not_instance_of(const value_t &value, const xtd::ustring &message)
Asserts that an object is not of the type supplied or a derived type.
Definition: assert.h:1754
static void is_null(const pointer_t *pointer)
Asserts that the pointer is null.
Definition: assert.h:2139
static void is_greater(const value1_t &val1, const value2_t &val2)
Asserts that the first value is greater than the second value.
Definition: assert.h:941
static void is_zero(const value_t &value)
Asserts that ta condition is zero.
Definition: assert.h:2547
static void is_not_null(const std::weak_ptr< pointer_t > &pointer)
Asserts that the pointer is not null.
Definition: assert.h:1974
static void are_equal(double expected, double actual, double tolerance)
Asserts that two type are equal.
Definition: assert.h:233
static void is_not_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that an object is not of the type supplied or a derived type.
Definition: assert.h:1741
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message)
Asserts that the pointer is null.
Definition: assert.h:2292
static void are_equal(const expected_t &expected, const actual_t &actual)
Asserts that two type are equal.
Definition: assert.h:50
static void are_not_equal(const expected_t &expected, const actual_t &actual)
Asserts that two type are not equal.
Definition: assert.h:354
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Asserts that two objects do refer to differents objects.
Definition: assert.h:552
static void is_not_null(const std::shared_ptr< pointer_t > &pointer)
Asserts that the pointer is not null.
Definition: assert.h:1912
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Asserts that two type are not equal.
Definition: assert.h:380
static void is_not_null(const pointer_t *pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is not null.
Definition: assert.h:1833
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are not equal.
Definition: assert.h:394
static void is_NaN(float value)
that a value is NaN.
Definition: assert.h:1498
static void is_false(bool condition, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that a condition is false.
Definition: assert.h:924
static void is_NaN(long double value, const xtd::ustring &message)
Asserts that a value is NaN.
Definition: assert.h:1467
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two objects do refer to differents objects.
Definition: assert.h:467
static void is_not_instance_of(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that an object is not of the type supplied or a derived type.
Definition: assert.h:1768
static void is_NaN(double value, const xtd::diagnostics::stack_frame &stack_frame)
that a value is NaN.
Definition: assert.h:1397
static void throws_any(const std::function< void()> &statement, const xtd::ustring &message)
Asserts that the staement does not throw an exception.
Definition: assert.h:2699
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two objects do refer to differents objects.
Definition: assert.h:536
static void are_equal(double expected, double actual, double tolerance, const xtd::ustring &message)
Asserts that two type are equal.
Definition: assert.h:261
static void is_instance_of(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that an object is of the type supplied or a derived type.
Definition: assert.h:1173
static void is_null(std::nullptr_t pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the pointer is null.
Definition: assert.h:2416
static void contains(const item_t &item, const collection_t &collection)
Asserts that collection contains an item.
Definition: assert.h:587
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message)
Asserts that the pointer is not null.
Definition: assert.h:2004
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that the first value is greater than or equal to the second value.
Definition: assert.h:1079
The base class for assert.
Definition: base_assert.h:25
static void fail()
Throws an xtd::tunit::assertion_error exception. This is used by the other Assert functions.
Definition: base_assert.h:70
static void succeed()
Generates a success with a generic message. This is used by the other Assert functions.
Definition: base_assert.h:140
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
#define csf_
Provides information about the current stack frame.
Definition: stack_frame.h:213
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17