xtd 0.2.0
valid.h
Go to the documentation of this file.
1 #pragma once
5 #include "assert.h"
6 
8 namespace xtd {
10  namespace tunit {
22  class tunit_export_ valid final : private base_assert {
23  public:
25  valid() = delete;
27 
29 
39  template<typename expected_t, typename actual_t>
40  static void are_equal(const expected_t& expected, const actual_t& actual) {are_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
41 
51  template<typename expected_t, typename actual_t>
52  static void are_equal(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equal(expected, actual, "", stack_frame);}
53 
63  template<typename expected_t, typename actual_t>
64  static void are_equal(const expected_t& expected, const actual_t& actual, const xtd::ustring& message) {are_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
65 
76  template<typename expected_t, typename actual_t>
77  static void are_equal(const expected_t& expected, const actual_t& actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
78  try {
79  assert::are_equal(expected, actual, message, stack_frame);
80  } catch (...) {
81  error();
82  }
83  }
84 
86  static void are_equal(const char* expected, const char* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
87 #if defined(__cpp_lib_char8_t)
88  static void are_equal(const char8* expected, const char8* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
89 #endif
90  static void are_equal(const char16* expected, const char16* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
91  static void are_equal(const char32* expected, const char32* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
92  static void are_equal(const wchar_t* expected, const wchar_t* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
93  static void are_equal(float expected, float actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
94  static void are_equal(double expected, double actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
95  static void are_equal(long double expected, long double actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
97 
108  static void are_equal(float expected, float actual, float tolerance);
120  static void are_equal(float expected, float actual, float tolerance, const xtd::diagnostics::stack_frame& stack_frame);
132  static void are_equal(float expected, float& actual, float tolerance, const xtd::ustring& message);
145  static void are_equal(float expected, float actual, float tolerance, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
156  static void are_equal(double expected, double actual, double tolerance);
168  static void are_equal(double expected, double actual, double tolerance, const xtd::diagnostics::stack_frame& stack_frame);
180  static void are_equal(double expected, double actual, double tolerance, const xtd::ustring& message);
193  static void are_equal(double expected, double actual, double tolerance, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
204  static void are_equal(long double expected, long double actual, long double tolerance);
216  static void are_equal(long double expected, long double actual, long double tolerance, const xtd::diagnostics::stack_frame& stack_frame);
228  static void are_equal(long double expected, long double actual, long double tolerance, const xtd::ustring& message);
241  static void are_equal(long double expected, long double actual, long double tolerance, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
242 
251  template<typename expected_t, typename actual_t>
252  static void are_not_equal(const expected_t& expected, const actual_t& actual) {are_not_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
253 
263  template<typename expected_t, typename actual_t>
264  static void are_not_equal(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equal(expected, actual, "", stack_frame);}
265 
275  template<typename expected_t, typename actual_t>
276  static void are_not_equal(const expected_t& expected, const actual_t& actual, const xtd::ustring& message) {are_not_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
277 
288  template<typename expected_t, typename actual_t>
289  static void are_not_equal(const expected_t& expected, const actual_t& actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
290  try {
291  assert::are_not_equal(expected, actual, message, stack_frame);
292  } catch (...) {
293  error();
294  }
295  }
296 
298  static void are_not_equal(const char* expected, const char* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
299 #if defined(__cpp_lib_char8_t)
300  static void are_not_equal(const char8* expected, const char8* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
301 #endif
302  static void are_not_equal(const char16* expected, const char16* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
303  static void are_not_equal(const char32* expected, const char32* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
304  static void are_not_equal(const wchar_t* expected, const wchar_t* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
306 
318  template<typename expected_t, typename actual_t>
319  static void are_not_same(const expected_t& expected, const actual_t& actual) {are_not_same(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
320 
333  template<typename expected_t, typename actual_t>
334  static void are_not_same(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_same(expected, actual, "", stack_frame);}
335 
348  template<typename expected_t, typename actual_t>
349  static void are_not_same(const expected_t& expected, const actual_t& actual, const xtd::ustring& message) {are_not_same(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
350 
364  template<typename expected_t, typename actual_t>
365  static void are_not_same(const expected_t& expected, const actual_t& actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
366  try {
367  assert::are_not_same(expected, actual, message, stack_frame);
368  } catch (...) {
369  error();
370  }
371  }
372 
384  template<typename expected_t, typename actual_t>
385  static void are_same(const expected_t& expected, const actual_t& actual) {are_same(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
386 
399  template<typename expected_t, typename actual_t>
400  static void are_same(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_same(expected, actual, "", stack_frame);}
401 
414  template<typename expected_t, typename actual_t>
415  static void are_same(const expected_t& expected, const actual_t& actual, const xtd::ustring& message) {are_same(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
416 
430  template<typename expected_t, typename actual_t>
431  static void are_same(const expected_t& expected, const actual_t& actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
432  try {
433  assert::are_same(expected, actual, message, stack_frame);
434  } catch (...) {
435  error();
436  }
437  }
438 
448  template<typename item_t, typename collection_t>
449  static void contains(const item_t& item, const collection_t& collection) {contains(item, collection, "", xtd::diagnostics::stack_frame::empty());}
450 
461  template<typename item_t, typename collection_t>
462  static void contains(const item_t& item, const collection_t& collection, const xtd::diagnostics::stack_frame& stack_frame) {contains(item, collection, "", stack_frame);}
463 
474  template<typename item_t, typename collection_t>
475  static void contains(const item_t& item, const collection_t& collection, const xtd::ustring& message) {contains(item, collection, message, xtd::diagnostics::stack_frame::empty());}
476 
488  template<typename item_t, typename collection_t>
489  static void contains(const item_t& item, const collection_t& collection, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
490  try {
491  assert::contains(item, collection, message, stack_frame);
492  } catch (...) {
493  error();
494  }
495  }
496 
498  template<typename item_t, typename value_t>
499  static void contains(const item_t& item, const std::initializer_list<value_t>& values) {contains(item, values, "", xtd::diagnostics::stack_frame::empty());}
500  template<typename item_t, typename value_t>
501  static void contains(const item_t& item, const std::initializer_list<value_t>& values, const xtd::diagnostics::stack_frame& stack_frame) {contains(item, values, "", stack_frame);}
502  template<typename item_t, typename value_t>
503  static void contains(const item_t& item, const std::initializer_list<value_t>& values, const xtd::ustring& message) {contains(item, values, message, xtd::diagnostics::stack_frame::empty());}
504  template<typename item_t, typename value_t>
505  static void contains(const item_t& item, const std::initializer_list<value_t>& values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
506  try {
507  assert::contains(item, values, message, stack_frame);
508  } catch (...) {
509  error();
510  }
511  }
512 
513  static void contains(char item, const char* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
514 #if defined(__cpp_lib_char8_t)
515  static void contains(char8 item, const char8* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
516 #endif
517  static void contains(char16 item, const char16* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
518  static void contains(char32 item, const char32* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
519  static void contains(wchar_t item, const wchar_t* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
521 
530  static void does_not_throw(const std::function<void()>& statement);
540  static void does_not_throw(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame);
550  static void does_not_throw(const std::function<void()>& statement, const xtd::ustring& message);
561  static void does_not_throw(const std::function<void()>& statement, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
562 
572  template<typename value_t>
573  static void is_empty(const value_t& value) {is_empty(value, "", xtd::diagnostics::stack_frame::empty());}
574 
585  template<typename value_t>
586  static void is_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_empty(value, "", stack_frame);}
587 
598  template<typename value_t>
599  static void is_empty(const value_t& value, const xtd::ustring& message) {is_empty(value, message, xtd::diagnostics::stack_frame::empty());}
600 
612  template<typename value_t>
613  static void is_empty(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
614  try {
615  assert::is_empty(value, message, stack_frame);
616  } catch (...) {
617  error();
618  }
619  }
620 
622  template<typename value_t>
623  static void is_empty(const std::initializer_list<value_t>& value) {is_empty(value, "", xtd::diagnostics::stack_frame::empty());}
624  template<typename value_t>
625  static void is_empty(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame) {is_empty(value, "", stack_frame);}
626  template<typename value_t>
627  static void is_empty(const std::initializer_list<value_t>& value, const xtd::ustring& message) {is_empty(value, message, xtd::diagnostics::stack_frame::empty());}
628  template<typename value_t>
629  static void is_empty(const std::initializer_list<value_t>& values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
630  try {
631  assert::is_empty(values, message, stack_frame);
632  } catch (...) {
633  error();
634  }
635  }
636 
637  static void is_empty(const char* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
638 #if defined(__cpp_lib_char8_t)
639  static void is_empty(const char8* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
640 #endif
641  static void is_empty(const char16* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
642  static void is_empty(const char32* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
643  static void is_empty(const wchar_t* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
645 
655  static void is_false(bool condition);
666  static void is_false(bool condition, const xtd::diagnostics::stack_frame& stack_frame);
677  static void is_false(bool condition, const xtd::ustring& message);
689  static void is_false(bool condition, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
690 
699  template<typename value1_t, typename value2_t>
700  static void is_greater(const value1_t& val1, const value2_t& val2) {is_greater(val1, val2, "", xtd::diagnostics::stack_frame::empty());}
701 
711  template<typename value1_t, typename value2_t>
712  static void is_greater(const value1_t& val1, const value2_t& val2, const xtd::diagnostics::stack_frame& stack_frame) {is_greater(val1, val2, "", stack_frame);}
713 
723  template<typename value1_t, typename value2_t>
724  static void is_greater(const value1_t& val1, const value2_t& val2, const xtd::ustring& message) {is_greater(val1, val2, message, xtd::diagnostics::stack_frame::empty());}
725 
736  template<typename value1_t, typename value2_t>
737  static void is_greater(const value1_t& val1, const value2_t& val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
738  try {
739  assert::is_greater(val1, val2, message, stack_frame);
740  } catch (...) {
741  error();
742  }
743  }
744 
746  static void is_greater(const char* val1, const char* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
747 #if defined(__cpp_lib_char8_t)
748  static void is_greater(const char8* val1, const char8* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
749 #endif
750  static void is_greater(const char16* val1, const char16* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
751  static void is_greater(const char32* val1, const char32* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
752  static void is_greater(const wchar_t* val1, const wchar_t* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
754 
764  template<typename value1_t, typename value2_t>
765  static void is_greater_or_equal(const value1_t& val1, const value2_t& val2) {is_greater_or_equal(val1, val2, "", xtd::diagnostics::stack_frame::empty());}
766 
777  template<typename value1_t, typename value2_t>
778  static void is_greater_or_equal(const value1_t& val1, const value2_t& val2, const xtd::diagnostics::stack_frame& stack_frame) {is_greater_or_equal(val1, val2, "", stack_frame);}
779 
790  template<typename value1_t, typename value2_t>
791  static void is_greater_or_equal(const value1_t& val1, const value2_t& val2, const xtd::ustring& message) {is_greater_or_equal(val1, val2, message, xtd::diagnostics::stack_frame::empty());}
792 
804  template<typename value1_t, typename value2_t>
805  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) {
806  try {
807  assert::is_greater_or_equal(val1, val2, message, stack_frame);
808  } catch (...) {
809  error();
810  }
811  }
812 
814  static void is_greater_or_equal(const char* val1, const char* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
815 #if defined(__cpp_lib_char8_t)
816  static void is_greater_or_equal(const char8* val1, const char8* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
817 #endif
818  static void is_greater_or_equal(const char16* val1, const char16* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
819  static void is_greater_or_equal(const char32* val1, const char32* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
820  static void is_greater_or_equal(const wchar_t* val1, const wchar_t* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
822 
831  template<typename type_t, typename value_t>
832  static void is_instance_of(const value_t& value) {is_instance_of<type_t>(value, "", xtd::diagnostics::stack_frame::empty());}
833 
843  template<typename type_t, typename value_t>
844  static void is_instance_of(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_instance_of<type_t>(value, "", stack_frame);}
845 
855  template<typename type_t, typename value_t>
856  static void is_instance_of(const value_t& value, const xtd::ustring& message) {is_instance_of<type_t>(value, message, xtd::diagnostics::stack_frame::empty());}
857 
868  template<typename type_t, typename value_t>
869  static void is_instance_of(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
870  try {
871  assert::is_instance_of<type_t>(value, message, stack_frame);
872  } catch (...) {
873  error();
874  }
875  }
876 
885  template<typename value1_t, typename value2_t>
886  static void is_less(const value1_t& val1, const value2_t& val2) {is_less(val1, val2, "", xtd::diagnostics::stack_frame::empty());}
887 
897  template<typename value1_t, typename value2_t>
898  static void is_less(const value1_t& val1, const value2_t& val2, const xtd::diagnostics::stack_frame& stack_frame) {is_less(val1, val2, "", stack_frame);}
899 
909  template<typename value1_t, typename value2_t>
910  static void is_less(const value1_t& val1, const value2_t& val2, const xtd::ustring& message) {is_less(val1, val2, message, xtd::diagnostics::stack_frame::empty());}
911 
922  template<typename value1_t, typename value2_t>
923  static void is_less(const value1_t& val1, const value2_t& val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
924  try {
925  assert::is_less(val1, val2, message, stack_frame);
926  } catch (...) {
927  error();
928  }
929  }
930 
932  static void is_less(const char* val1, const char* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
933 #if defined(__cpp_lib_char8_t)
934  static void is_less(const char8* val1, const char8* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
935 #endif
936  static void is_less(const char16* val1, const char16* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
937  static void is_less(const char32* val1, const char32* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
938  static void is_less(const wchar_t* val1, const wchar_t* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
940 
950  template<typename value1_t, typename value2_t>
951  static void is_less_or_equal(const value1_t& val1, const value2_t& val2) {is_less_or_equal(val1, val2, "", xtd::diagnostics::stack_frame::empty());}
952 
963  template<typename value1_t, typename value2_t>
964  static void is_less_or_equal(const value1_t& val1, const value2_t& val2, const xtd::diagnostics::stack_frame& stack_frame) {is_less_or_equal(val1, val2, "", stack_frame);}
965 
976  template<typename value1_t, typename value2_t>
977  static void is_less_or_equal(const value1_t& val1, const value2_t& val2, const xtd::ustring& message) {is_less_or_equal(val1, val2, message, xtd::diagnostics::stack_frame::empty());}
978 
990  template<typename value1_t, typename value2_t>
991  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) {
992  try {
993  assert::is_less_or_equal(val1, val2, message, stack_frame);
994  } catch (...) {
995  error();
996  }
997  }
998 
1000  static void is_less_or_equal(const char* val1, const char* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1001 #if defined(__cpp_lib_char8_t)
1002  static void is_less_or_equal(const char8* val1, const char8* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1003 #endif
1004  static void is_less_or_equal(const char16* val1, const char16* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1005  static void is_less_or_equal(const char32* val1, const char32* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1006  static void is_less_or_equal(const wchar_t* val1, const wchar_t* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1008 
1018  static void is_NaN(double value);
1029  static void is_NaN(double value, const xtd::diagnostics::stack_frame& stack_frame);
1040  static void is_NaN(double value, const xtd::ustring& message);
1052  static void is_NaN(double value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1062  static void is_NaN(long double value);
1073  static void is_NaN(long double value, const xtd::diagnostics::stack_frame& stack_frame);
1084  static void is_NaN(long double value, const xtd::ustring& message);
1096  static void is_NaN(long double value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1106  static void is_NaN(float value);
1117  static void is_NaN(float value, const xtd::diagnostics::stack_frame& stack_frame);
1128  static void is_NaN(float value, const xtd::ustring& message);
1140  static void is_NaN(float value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1141 
1151  template<typename value_t>
1152  static void is_negative(const value_t& value) {is_negative(value, "", xtd::diagnostics::stack_frame::empty());}
1153 
1164  template<typename value_t>
1165  static void is_negative(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_negative(value, "", stack_frame);}
1166 
1177  template<typename value_t>
1178  static void is_negative(const value_t& value, const xtd::ustring& message) {is_negative(value, message, xtd::diagnostics::stack_frame::empty());}
1179 
1191  template<typename value_t>
1192  static void is_negative(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1193  try {
1194  assert::is_negative(value, message, stack_frame);
1195  } catch (...) {
1196  error();
1197  }
1198  }
1199 
1209  template<typename value_t>
1210  static void is_not_empty(const value_t& value) {is_not_empty(value, "", xtd::diagnostics::stack_frame::empty());}
1211 
1222  template<typename value_t>
1223  static void is_not_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_empty(value, "", stack_frame);}
1224 
1235  template<typename value_t>
1236  static void is_not_empty(const value_t& value, const xtd::ustring& message) {is_not_empty(value, message, xtd::diagnostics::stack_frame::empty());}
1237 
1249  template<typename value_t>
1250  static void is_not_empty(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1251  try {
1252  assert::is_not_empty(value, message, stack_frame);
1253  } catch (...) {
1254  error();
1255  }
1256  }
1257 
1259  template<typename value_t>
1260  static void is_not_empty(const std::initializer_list<value_t>& value) {is_not_empty(value, "", xtd::diagnostics::stack_frame::empty());}
1261  template<typename value_t>
1262  static void is_not_empty(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_empty(value, "", stack_frame);}
1263  template<typename value_t>
1264  static void is_not_empty(const std::initializer_list<value_t>& value, const xtd::ustring& message) {is_not_empty(value, message, xtd::diagnostics::stack_frame::empty());}
1265  template<typename value_t>
1266  static void is_not_empty(const std::initializer_list<value_t>& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1267  try {
1268  assert::is_not_empty(value, message, stack_frame);
1269  } catch (...) {
1270  error();
1271  }
1272  }
1273 
1274  static void is_not_empty(const char* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1275 #if defined(__cpp_lib_char8_t)
1276  static void is_not_empty(const char8* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1277 #endif
1278  static void is_not_empty(const char16* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1279  static void is_not_empty(const char32* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1280  static void is_not_empty(const wchar_t* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1282 
1291  template<typename type_t, typename value_t>
1292  static void is_not_instance_of(const value_t& value) {is_not_instance_of<type_t>(value, "", xtd::diagnostics::stack_frame::empty());}
1293 
1303  template<typename type_t, typename value_t>
1304  static void is_not_instance_of(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_instance_of<type_t>(value, "", stack_frame);}
1305 
1315  template<typename type_t, typename value_t>
1316  static void is_not_instance_of(const value_t& value, const xtd::ustring& message) {is_not_instance_of<type_t>(value, message, xtd::diagnostics::stack_frame::empty());}
1317 
1328  template<typename type_t, typename value_t>
1329  static void is_not_instance_of(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1330  try {
1331  assert::is_not_instance_of<type_t>(value, message, stack_frame);
1332  } catch (...) {
1333  error();
1334  }
1335  }
1336 
1347  template<typename pointer_t>
1348  static void is_not_null(const pointer_t* pointer) {is_not_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1349 
1361  template<typename pointer_t>
1362  static void is_not_null(const pointer_t* pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_not_null(pointer, "", stack_frame);}
1363 
1375  template<typename pointer_t>
1376  static void is_not_null(const pointer_t* pointer, const xtd::ustring& message) {is_not_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1377 
1390  template<typename pointer_t>
1391  static void is_not_null(const pointer_t* pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1392  try {
1393  assert::is_not_null(pointer, message, stack_frame);
1394  } catch (...) {
1395  error();
1396  }
1397  }
1398 
1408  template<typename optional_t>
1409  static void is_not_null(const std::optional<optional_t>& opt) {is_not_null(opt, "", xtd::diagnostics::stack_frame::empty());}
1410 
1421  template<typename optional_t>
1422  static void is_not_null(const std::optional<optional_t>& opt, const xtd::diagnostics::stack_frame& stack_frame) {is_not_null(opt, "", stack_frame);}
1423 
1434  template<typename optional_t>
1435  static void is_not_null(const std::optional<optional_t>& opt, const xtd::ustring& message) {is_not_null(opt, message, xtd::diagnostics::stack_frame::empty());}
1436 
1448  template<typename optional_t>
1449  static void is_not_null(const std::optional<optional_t>& opt, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1450  try {
1451  assert::is_not_null(opt, message, stack_frame);
1452  } catch (...) {
1453  error();
1454  }
1455  }
1456 
1466  template<typename pointer_t>
1467  static void is_not_null(const std::unique_ptr<pointer_t>& pointer) {is_not_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1468 
1479  template<typename pointer_t>
1480  static void is_not_null(const std::unique_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_not_null(pointer, "", stack_frame);}
1481 
1492  template<typename pointer_t>
1493  static void is_not_null(const std::unique_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_not_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1494 
1506  template<typename pointer_t>
1507  static void is_not_null(const std::unique_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1508  try {
1509  assert::is_not_null(pointer, message, stack_frame);
1510  } catch (...) {
1511  error();
1512  }
1513  }
1514 
1524  template<typename pointer_t>
1525  static void is_not_null(const std::shared_ptr<pointer_t>& pointer) {is_not_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1526 
1537  template<typename pointer_t>
1538  static void is_not_null(const std::shared_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_not_null(pointer, "", stack_frame);}
1539 
1550  template<typename pointer_t>
1551  static void is_not_null(const std::shared_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_not_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1552 
1564  template<typename pointer_t>
1565  static void is_not_null(const std::shared_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1566  try {
1567  assert::is_not_null(pointer, message, stack_frame);
1568  } catch (...) {
1569  error();
1570  }
1571  }
1572 
1584  template<typename pointer_t>
1585  static void is_not_null(const std::weak_ptr<pointer_t>& pointer) {is_not_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1586 
1599  template<typename pointer_t>
1600  static void is_not_null(const std::weak_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_not_null(pointer, "", stack_frame);}
1601 
1614  template<typename pointer_t>
1615  static void is_not_null(const std::weak_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_not_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1616 
1630  template<typename pointer_t>
1631  static void is_not_null(const std::weak_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {assert::succeed(message, stack_frame);}
1632 
1640  static void is_not_null(std::nullptr_t pointer);
1649  static void is_not_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame& stack_frame);
1658  static void is_not_null(std::nullptr_t pointer, const xtd::ustring& message);
1668  static void is_not_null(std::nullptr_t pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1669 
1679  template<typename value_t>
1680  static void is_not_zero(const value_t& value) {is_not_zero(value, "", xtd::diagnostics::stack_frame::empty());}
1681 
1692  template<typename value_t>
1693  static void is_not_zero(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_zero(value, "", stack_frame);}
1694 
1705  template<typename value_t>
1706  static void is_not_zero(const value_t& value, const xtd::ustring& message) {is_not_zero(value, message, xtd::diagnostics::stack_frame::empty());}
1707 
1719  template<typename value_t>
1720  static void is_not_zero(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1721  try {
1722  assert::is_not_zero(value, message, stack_frame);
1723  } catch (...) {
1724  error();
1725  }
1726  }
1727 
1738  template<typename pointer_t>
1739  static void is_null(const pointer_t* pointer) {is_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1740 
1752  template<typename pointer_t>
1753  static void is_null(const pointer_t* pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_null(pointer, "", stack_frame);}
1754 
1766  template<typename pointer_t>
1767  static void is_null(const pointer_t* pointer, const xtd::ustring& message) {is_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1768 
1781  template<typename pointer_t>
1782  static void is_null(const pointer_t* pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1783  try {
1784  assert::is_null(pointer, message, stack_frame);
1785  } catch (...) {
1786  error();
1787  }
1788  }
1789 
1799  template<typename optional_t>
1800  static void is_null(const std::optional<optional_t>& opt) {is_null(opt, "", xtd::diagnostics::stack_frame::empty());}
1801 
1812  template<typename optional_t>
1813  static void is_null(const std::optional<optional_t>& opt, const xtd::diagnostics::stack_frame& stack_frame) {is_null(opt, "", stack_frame);}
1814 
1825  template<typename optional_t>
1826  static void is_null(const std::optional<optional_t>& opt, const xtd::ustring& message) {is_null(opt, message, xtd::diagnostics::stack_frame::empty());}
1827 
1839  template<typename optional_t>
1840  static void is_null(const std::optional<optional_t>& opt, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1841  try {
1842  assert::is_null(opt, message, stack_frame);
1843  } catch (...) {
1844  error();
1845  }
1846  }
1847 
1857  template<typename pointer_t>
1858  static void is_null(const std::unique_ptr<pointer_t>& pointer) {is_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1859 
1870  template<typename pointer_t>
1871  static void is_null(const std::unique_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_null(pointer, "", stack_frame);}
1872 
1883  template<typename pointer_t>
1884  static void is_null(const std::unique_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1885 
1897  template<typename pointer_t>
1898  static void is_null(const std::unique_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1899  try {
1900  assert::is_null(pointer, message, stack_frame);
1901  } catch (...) {
1902  error();
1903  }
1904  }
1905 
1915  template<typename pointer_t>
1916  static void is_null(const std::shared_ptr<pointer_t>& pointer) {is_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1917 
1928  template<typename pointer_t>
1929  static void is_null(const std::shared_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_null(pointer, "", stack_frame);}
1930 
1941  template<typename pointer_t>
1942  static void is_null(const std::shared_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1943 
1955  template<typename pointer_t>
1956  static void is_null(const std::shared_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1957  try {
1958  assert::is_null(pointer, message, stack_frame);
1959  } catch (...) {
1960  error();
1961  }
1962  }
1963 
1975  template<typename pointer_t>
1976  static void is_null(const std::weak_ptr<pointer_t>& pointer) {is_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1977 
1990  template<typename pointer_t>
1991  static void is_null(const std::weak_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_null(pointer, "", stack_frame);}
1992 
2005  template<typename pointer_t>
2006  static void is_null(const std::weak_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
2007 
2021  template<typename pointer_t>
2022  static void is_null(const std::weak_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2023  try {
2024  assert::is_null(pointer, message, stack_frame);
2025  } catch (...) {
2026  error();
2027  }
2028  }
2029 
2037  static void is_null(std::nullptr_t pointer);
2046  static void is_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame& stack_frame);
2055  static void is_null(std::nullptr_t pointer, const xtd::ustring& message);
2065  static void is_null(std::nullptr_t pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
2066 
2076  template<typename value_t>
2077  static void is_positive(const value_t& value) {is_positive(value, "", xtd::diagnostics::stack_frame::empty());}
2078 
2089  template<typename value_t>
2090  static void is_positive(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_positive(value, "", stack_frame);}
2091 
2102  template<typename value_t>
2103  static void is_positive(const value_t& value, const xtd::ustring& message) {is_positive(value, message, xtd::diagnostics::stack_frame::empty());}
2104 
2116  template<typename value_t>
2117  static void is_positive(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2118  try {
2119  assert::is_positive(value, message, stack_frame);
2120  } catch (...) {
2121  error();
2122  }
2123  }
2124 
2134  static void is_true(bool condition);
2145  static void is_true(bool condition, const xtd::diagnostics::stack_frame& stack_frame);
2156  static void is_true(bool condition, const xtd::ustring& message);
2168  static void is_true(bool condition, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
2169 
2179  template<typename value_t>
2180  static void is_zero(const value_t& value) {is_zero(value, "", xtd::diagnostics::stack_frame::empty());}
2181 
2192  template<typename value_t>
2193  static void is_zero(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_zero(value, "", stack_frame);}
2194 
2205  template<typename value_t>
2206  static void is_zero(const value_t& value, const xtd::ustring& message) {is_zero(value, message, xtd::diagnostics::stack_frame::empty());}
2207 
2219  template<typename value_t>
2220  static void is_zero(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2221  try {
2222  assert::is_zero(value, message, stack_frame);
2223  } catch (...) {
2224  error();
2225  }
2226  }
2227 
2237  template<typename exception_t>
2238  static void throws(const std::function<void()>& statement) {throws<exception_t>(statement, "", xtd::diagnostics::stack_frame::empty());}
2239 
2250  template<typename exception_t>
2251  static void throws(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame) {throws<exception_t>(statement, "", stack_frame);}
2252 
2263  template<typename exception_t>
2264  static void throws(const std::function<void()>& statement, const xtd::ustring& message) {throws<exception_t>(statement, message, xtd::diagnostics::stack_frame::empty());}
2265 
2277  template<typename exception_t>
2278  static void throws(const std::function<void()>& statement, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2279  try {
2280  assert::throws<exception_t>(statement, message, stack_frame);
2281  } catch (...) {
2282  error();
2283  }
2284  }
2285 
2294  static void throws_any(const std::function<void()>& statement);
2304  static void throws_any(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame);
2314  static void throws_any(const std::function<void()>& statement, const xtd::ustring& message);
2325  static void throws_any(const std::function<void()>& statement, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
2327  };
2328  }
2329 }
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:920
static void is_zero(const value_t &value)
Asserts that ta condition is zero.
Definition: assert.h:2221
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message)
Validates that the pointer is not null.
Definition: valid.h:1493
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Validates that the first value is greater than the second value.
Definition: valid.h:724
The base class for assert.
Definition: base_assert.h:29
static void contains(const item_t &item, const collection_t &collection, const xtd::ustring &message)
Validates that collection contains an item.
Definition: valid.h:475
static void is_null(const pointer_t *pointer)
Asserts that the pointer is null.
Definition: assert.h:1781
static void is_not_null(const pointer_t *pointer, const xtd::ustring &message)
Validates that the pointer is not null.
Definition: valid.h:1376
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is not null.
Definition: valid.h:1507
static void succeed()
Generates a success with a generic message. This is used by the other assert functions.
static void is_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that ta condition is zero.
Definition: valid.h:2193
static void is_positive(const value_t &value)
Validates that ta condition is positive.
Definition: valid.h:2077
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the first value is greater than or equal to the second value.
Definition: valid.h:778
static void is_empty(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains an item.
Definition: valid.h:613
static void is_instance_of(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that an object is of the type supplied or a derived type.
Definition: valid.h:869
static void is_less_or_equal(const value1_t &val1, const value2_t &val2)
Validates that the first value is is_less than or equal to the second value.
Definition: valid.h:951
static void is_not_empty(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection does not contain any item.
Definition: valid.h:1250
static void is_negative(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that ta condition is negative.
Definition: valid.h:1165
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that two type are equal.
Definition: valid.h:52
static void is_null(const std::weak_ptr< pointer_t > &pointer)
Validates that the pointer is null.
Definition: valid.h:1976
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)
Validates that the first value is greater than or equal to the second value.
Definition: valid.h:805
static void are_not_equal(const expected_t &expected, const actual_t &actual)
Asserts that two type are not equal.
Definition: assert.h:279
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that two type are not equal.
Definition: valid.h:264
static void is_positive(const value_t &value)
Asserts that ta condition is positive.
Definition: assert.h:2114
static void are_same(const expected_t &expected, const actual_t &actual)
Asserts that two objects do refer to differents objects.
Definition: assert.h:412
static void is_positive(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that ta condition is positive.
Definition: valid.h:2117
static void is_not_empty(const value_t &value)
Asserts that collection oes not contain any item.
Definition: assert.h:1256
static void is_negative(const value_t &value, const xtd::ustring &message)
Validates that ta condition is negative.
Definition: valid.h:1178
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
static void is_not_instance_of(const value_t &value, const xtd::ustring &message)
Validates that an object is not of the type supplied or a derived type.
Definition: valid.h:1316
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the first value is is_less than the second value.
Definition: valid.h:923
static void is_greater(const value1_t &val1, const value2_t &val2)
Validates that the first value is greater than the second value.
Definition: valid.h:700
static void is_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains an item.
Definition: valid.h:586
static void is_null(const std::shared_ptr< pointer_t > &pointer)
Validates that the pointer is null.
Definition: valid.h:1916
static void contains(const item_t &item, const collection_t &collection)
Validates that collection contains an item.
Definition: valid.h:449
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2)
Validates that the first value is greater than or equal to the second value.
Definition: valid.h:765
static void is_null(const pointer_t *pointer, const xtd::ustring &message)
Validates that the pointer is null.
Definition: valid.h:1767
static void is_null(const pointer_t *pointer)
Validates that the pointer is null.
Definition: valid.h:1739
static void is_not_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that ta condition is not zero.
Definition: valid.h:1693
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:346
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that two objects do refer to different objects.
Definition: valid.h:400
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the first value is greater than the second value.
Definition: valid.h:712
static void is_not_null(const pointer_t *pointer)
Validates that the pointer is not null.
Definition: valid.h:1348
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that two objects do refer to different objects.
Definition: valid.h:365
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)
Validates that the first value is is_less than or equal to the second value.
Definition: valid.h:991
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message)
Validates that the pointer is null.
Definition: valid.h:1884
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is not null.
Definition: valid.h:1480
static void is_positive(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that ta condition is positive.
Definition: valid.h:2090
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the first value is greater than the second value.
Definition: valid.h:737
static void is_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is null.
Definition: valid.h:1753
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is null.
Definition: valid.h:2022
static void is_negative(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that ta condition is negative.
Definition: valid.h:1192
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:733
static void is_empty(const value_t &value)
Validates that collection contains an item.
Definition: valid.h:573
static void is_negative(const value_t &value)
Validates that ta condition is negative.
Definition: valid.h:1152
static void is_null(const std::optional< optional_t > &opt, const xtd::ustring &message)
Validates that the optional is std::nullopt.
Definition: valid.h:1826
static void is_not_null(const std::weak_ptr< pointer_t > &pointer)
Validates that the pointer is not null.
Definition: valid.h:1585
static void is_zero(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that ta condition is zero.
Definition: valid.h:2220
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Validates that two type are equal.
Definition: valid.h:64
static void is_not_null(const std::optional< optional_t > &opt, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the optional is not std::nullopt.
Definition: valid.h:1422
static void is_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that an object is of the type supplied or a derived type.
Definition: valid.h:844
static void is_not_null(const pointer_t *pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is not null.
Definition: valid.h:1391
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is null.
Definition: valid.h:1991
static void is_not_null(const std::optional< optional_t > &opt, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the optional is not std::nullopt.
Definition: valid.h:1449
static void is_not_null(const std::shared_ptr< pointer_t > &pointer)
Validates that the pointer is not null.
Definition: valid.h:1525
static void is_empty(const value_t &value)
Asserts that collection contains an item.
Definition: assert.h:604
static void is_less(const value1_t &val1, const value2_t &val2)
Validates that the first value is is_less than the second value.
Definition: valid.h:886
static void is_instance_of(const value_t &value)
Validates that an object is of the type supplied or a derived type.
Definition: valid.h:832
static void is_not_empty(const value_t &value, const xtd::ustring &message)
Validates that collection does not contain any item.
Definition: valid.h:1236
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Validates that the first value is is_less than the second value.
Definition: valid.h:910
static void contains(const item_t &item, const collection_t &collection)
Asserts that collection contains an item.
Definition: assert.h:476
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Validates that two objects do refer to different objects.
Definition: valid.h:415
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is not null.
Definition: valid.h:1631
static void is_null(const std::optional< optional_t > &opt)
Validates that the optional is std::nullopt.
Definition: valid.h:1800
static void is_not_instance_of(const value_t &value)
Validates that an object is not of the type supplied or a derived type.
Definition: valid.h:1292
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the first value is is_less than or equal to the second value.
Definition: valid.h:964
static void is_not_empty(const value_t &value)
Validates that collection oes not contain any item.
Definition: valid.h:1210
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:37
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that two type are equal.
Definition: valid.h:77
static void is_not_null(const pointer_t *pointer)
Asserts that the pointer is not null.
Definition: assert.h:1393
static stack_frame empty() noexcept
Return an empty stack frame.
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message)
Validates that the pointer is not null.
Definition: valid.h:1551
static void is_not_null(const std::unique_ptr< pointer_t > &pointer)
Validates that the pointer is not null.
Definition: valid.h:1467
static void is_zero(const value_t &value)
Validates that ta condition is zero.
Definition: valid.h:2180
static void is_zero(const value_t &value, const xtd::ustring &message)
Validates that ta condition is zero.
Definition: valid.h:2206
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Validates that the first value is is_less than or equal to the second value.
Definition: valid.h:977
Contains xtd::tunit::assert class.
static void is_not_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is not null.
Definition: valid.h:1362
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is null.
Definition: valid.h:1898
static void is_not_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that an object is not of the type supplied or a derived type.
Definition: valid.h:1304
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the first value is is_less than the second value.
Definition: valid.h:898
static void is_positive(const value_t &value, const xtd::ustring &message)
Validates that ta condition is positive.
Definition: valid.h:2103
static void are_equal(const expected_t &expected, const actual_t &actual)
Validates that two type are equal.
Definition: valid.h:40
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that two type are not equal.
Definition: valid.h:289
static void are_not_same(const expected_t &expected, const actual_t &actual)
Validates that two objects do refer to different objects.
Definition: valid.h:319
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message)
Validates that the pointer is null.
Definition: valid.h:2006
static void is_not_instance_of(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that an object is not of the type supplied or a derived type.
Definition: valid.h:1329
static void is_null(const pointer_t *pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is null.
Definition: valid.h:1782
char32_t char32
Represents a 32-bit unicode character.
Definition: types.h:85
static void is_not_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection does not contain any item.
Definition: valid.h:1223
static void is_not_null(const std::optional< optional_t > &opt)
Validates that the optional is not std::nullopt.
Definition: valid.h:1409
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Validates that two type are not equal.
Definition: valid.h:276
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Validates that two objects do refer to different objects.
Definition: valid.h:349
static void is_null(const std::optional< optional_t > &opt, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the optional is std::nullopt.
Definition: valid.h:1840
static void contains(const item_t &item, const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains an item.
Definition: valid.h:462
static void contains(const item_t &item, const collection_t &collection, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains an item.
Definition: valid.h:489
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that two objects do refer to different objects.
Definition: valid.h:334
static void is_not_zero(const value_t &value)
Validates that ta condition is not zero.
Definition: valid.h:1680
static void is_negative(const value_t &value)
Asserts that ta condition is negative.
Definition: assert.h:1198
static void is_not_zero(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that ta condition is not zero.
Definition: valid.h:1720
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is not null.
Definition: valid.h:1538
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message)
Validates that the pointer is not null.
Definition: valid.h:1615
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that two objects do refer to different objects.
Definition: valid.h:431
The valid class contains a collection of static methods that implement the most common assertions use...
Definition: valid.h:22
static void is_not_zero(const value_t &value)
Asserts that ta condition is not zero.
Definition: assert.h:1722
static void is_not_zero(const value_t &value, const xtd::ustring &message)
Validates that ta condition is not zero.
Definition: valid.h:1706
char8_t char8
Represents a 8-bit unicode character.
Definition: types.h:62
static void is_instance_of(const value_t &value, const xtd::ustring &message)
Validates that an object is of the type supplied or a derived type.
Definition: valid.h:856
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is null.
Definition: valid.h:1871
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is not null.
Definition: valid.h:1565
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message)
Validates that the pointer is null.
Definition: valid.h:1942
static void is_null(const std::optional< optional_t > &opt, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the optional is std::nullopt.
Definition: valid.h:1813
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Validates that the first value is greater than or equal to the second value.
Definition: valid.h:791
char16_t char16
Represents a 16-bit unicode character.
Definition: types.h:74
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is null.
Definition: valid.h:1956
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is not null.
Definition: valid.h:1600
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Validates that the pointer is null.
Definition: valid.h:1929
static void are_equal(const expected_t &expected, const actual_t &actual)
Asserts that two type are equal.
Definition: assert.h:55
static void is_not_null(const std::optional< optional_t > &opt, const xtd::ustring &message)
Validates that the optional is not std::nullopt.
Definition: valid.h:1435
static void are_same(const expected_t &expected, const actual_t &actual)
Validates that two objects do refer to different objects.
Definition: valid.h:385
static void is_null(const std::unique_ptr< pointer_t > &pointer)
Validates that the pointer is null.
Definition: valid.h:1858
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:985
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:798
static void is_empty(const value_t &value, const xtd::ustring &message)
Validates that collection contains an item.
Definition: valid.h:599
static void are_not_equal(const expected_t &expected, const actual_t &actual)
Validates that two type are not equal.
Definition: valid.h:252