xtd 0.2.0
assume.h
Go to the documentation of this file.
1 #pragma once
5 #include "assert.h"
6 
8 namespace xtd {
10  namespace tunit {
21  class tunit_export_ assume final : private base_assert {
22  public:
24  assume() = delete;
26 
28 
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());}
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);}
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());}
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  assert::abort();
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 
109  static void are_equal(float expected, float actual, float tolerance);
122  static void are_equal(float expected, float actual, float tolerance, const xtd::diagnostics::stack_frame& stack_frame);
135  static void are_equal(float expected, float& actual, float tolerance, const xtd::ustring& message);
149  static void are_equal(float expected, float actual, float tolerance, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
161  static void are_equal(double expected, double actual, double tolerance);
174  static void are_equal(double expected, double actual, double tolerance, const xtd::diagnostics::stack_frame& stack_frame);
187  static void are_equal(double expected, double actual, double tolerance, const xtd::ustring& message);
201  static void are_equal(double expected, double actual, double tolerance, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
213  static void are_equal(long double expected, long double actual, long double tolerance);
226  static void are_equal(long double expected, long double actual, long double tolerance, const xtd::diagnostics::stack_frame& stack_frame);
239  static void are_equal(long double expected, long double actual, long double tolerance, const xtd::ustring& message);
253  static void are_equal(long double expected, long double actual, long double tolerance, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
254 
264  template<typename expected_t, typename actual_t>
265  static void are_not_equal(const expected_t& expected, const actual_t& actual) {are_not_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
276  template<typename expected_t, typename actual_t>
277  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);}
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) {are_not_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
290 
302  template<typename expected_t, typename actual_t>
303  static void are_not_equal(const expected_t& expected, const actual_t& actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
304  try {
305  assert::are_not_equal(expected, actual, message, stack_frame);
306  } catch (...) {
307  assert::abort();
308  }
309  }
310 
312  static void are_not_equal(const char* expected, const char* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
313 #if defined(__cpp_lib_char8_t)
314  static void are_not_equal(const char8* expected, const char8* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
315 #endif
316  static void are_not_equal(const char16* expected, const char16* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
317  static void are_not_equal(const char32* expected, const char32* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
318  static void are_not_equal(const wchar_t* expected, const wchar_t* actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
320 
333  template<typename expected_t, typename actual_t>
334  static void are_not_same(const expected_t& expected, const actual_t& actual) {are_not_same(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
348  template<typename expected_t, typename actual_t>
349  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);}
363  template<typename expected_t, typename actual_t>
364  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());}
379  template<typename expected_t, typename actual_t>
380  static void are_not_same(const expected_t& expected, const actual_t& actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
381  try {
382  assert::are_not_same(expected, actual, message, stack_frame);
383  } catch (...) {
384  assert::abort();
385  }
386  }
387 
400  template<typename expected_t, typename actual_t>
401  static void are_same(const expected_t& expected, const actual_t& actual) {are_same(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
415  template<typename expected_t, typename actual_t>
416  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);}
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) {are_same(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
446  template<typename expected_t, typename actual_t>
447  static void are_same(const expected_t& expected, const actual_t& actual, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
448  try {
449  assert::are_same(expected, actual, message, stack_frame);
450  } catch (...) {
451  assert::abort();
452  }
453  }
454 
465  template<typename item_t, typename collection_t>
466  static void contains(const item_t& item, const collection_t& collection) {contains(item, collection, "", xtd::diagnostics::stack_frame::empty());}
478  template<typename item_t, typename collection_t>
479  static void contains(const item_t& item, const collection_t& collection, const xtd::diagnostics::stack_frame& stack_frame) {contains(item, collection, "", stack_frame);}
491  template<typename item_t, typename collection_t>
492  static void contains(const item_t& item, const collection_t& collection, const xtd::ustring& message) {contains(item, collection, message, xtd::diagnostics::stack_frame::empty());}
505  template<typename item_t, typename collection_t>
506  static void contains(const item_t& item, const collection_t& collection, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
507  try {
508  assert::contains(item, collection, message, stack_frame);
509  } catch (...) {
510  assert::abort();
511  }
512  }
513 
515  template<typename item_t, typename value_t>
516  static void contains(const item_t& item, const std::initializer_list<value_t>& values) {contains(item, values, "", xtd::diagnostics::stack_frame::empty());}
517  template<typename item_t, typename value_t>
518  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);}
519  template<typename item_t, typename value_t>
520  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());}
521  template<typename item_t, typename value_t>
522  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) {
523  try {
524  assert::contains(item, values, message, stack_frame);
525  } catch (...) {
526  assert::abort();
527  }
528  }
529  static void contains(char item, const char* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
530 #if defined(__cpp_lib_char8_t)
531  static void contains(char8 item, const char8* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
532 #endif
533  static void contains(char16 item, const char16* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
534  static void contains(char32 item, const char32* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
535  static void contains(wchar_t item, const wchar_t* values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
537 
547  static void does_not_throw(const std::function<void()>& statement);
558  static void does_not_throw(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame);
569  static void does_not_throw(const std::function<void()>& statement, const xtd::ustring& message);
581  static void does_not_throw(const std::function<void()>& statement, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
582 
593  template<typename value_t>
594  static void is_empty(const value_t& value) {is_empty(value, "", xtd::diagnostics::stack_frame::empty());}
606  template<typename value_t>
607  static void is_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_empty(value, "", stack_frame);}
619  template<typename value_t>
620  static void is_empty(const value_t& value, const xtd::ustring& message) {is_empty(value, message, xtd::diagnostics::stack_frame::empty());}
633  template<typename value_t>
634  static void is_empty(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
635  try {
636  assert::is_empty(value, message, stack_frame);
637  } catch (...) {
638  assert::abort();
639  }
640  }
641 
643  template<typename value_t>
644  static void is_empty(const std::initializer_list<value_t>& value) {is_empty(value, "", xtd::diagnostics::stack_frame::empty());}
645  template<typename value_t>
646  static void is_empty(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame) {is_empty(value, "", stack_frame);}
647  template<typename value_t>
648  static void is_empty(const std::initializer_list<value_t>& value, const xtd::ustring& message) {is_empty(value, message, xtd::diagnostics::stack_frame::empty());}
649  template<typename value_t>
650  static void is_empty(const std::initializer_list<value_t>& values, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
651  try {
652  assert::is_empty(values, message, stack_frame);
653  } catch (...) {
654  assert::abort();
655  }
656  }
657  static void is_empty(const char* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
658 #if defined(__cpp_lib_char8_t)
659  static void is_empty(const char8* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
660 #endif
661  static void is_empty(const char16* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
662  static void is_empty(const char32* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
663  static void is_empty(const wchar_t* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
665 
676  static void is_false(bool condition);
688  static void is_false(bool condition, const xtd::diagnostics::stack_frame& stack_frame);
700  static void is_false(bool condition, const xtd::ustring& message);
713  static void is_false(bool condition, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
714 
724  template<typename value1_t, typename value2_t>
725  static void is_greater(const value1_t& val1, const value2_t& val2) {is_greater(val1, val2, "", xtd::diagnostics::stack_frame::empty());}
736  template<typename value1_t, typename value2_t>
737  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);}
748  template<typename value1_t, typename value2_t>
749  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());}
761  template<typename value1_t, typename value2_t>
762  static void is_greater(const value1_t& val1, const value2_t& val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
763  try {
764  assert::is_greater(val1, val2, message, stack_frame);
765  } catch (...) {
766  assert::abort();
767  }
768  }
769 
771  static void is_greater(const char* val1, const char* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
772 #if defined(__cpp_lib_char8_t)
773  static void is_greater(const char8* val1, const char8* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
774 #endif
775  static void is_greater(const char16* val1, const char16* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
776  static void is_greater(const char32* val1, const char32* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
777  static void is_greater(const wchar_t* val1, const wchar_t* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& 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) {is_greater_or_equal(val1, val2, "", xtd::diagnostics::stack_frame::empty());}
803  template<typename value1_t, typename value2_t>
804  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);}
816  template<typename value1_t, typename value2_t>
817  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());}
830  template<typename value1_t, typename value2_t>
831  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) {
832  try {
833  assert::is_greater_or_equal(val1, val2, message, stack_frame);
834  } catch (...) {
835  assert::abort();
836  }
837  }
838 
840  static void is_greater_or_equal(const char* val1, const char* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
841 #if defined(__cpp_lib_char8_t)
842  static void is_greater_or_equal(const char8* val1, const char8* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
843 #endif
844  static void is_greater_or_equal(const char16* val1, const char16* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
845  static void is_greater_or_equal(const char32* val1, const char32* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
846  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);
848 
858  template<typename type_t, typename value_t>
859  static void is_instance_of(const value_t& value) {is_instance_of<type_t>(value, "", xtd::diagnostics::stack_frame::empty());}
870  template<typename type_t, typename value_t>
871  static void is_instance_of(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_instance_of<type_t>(value, "", stack_frame);}
882  template<typename type_t, typename value_t>
883  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());}
895  template<typename type_t, typename value_t>
896  static void is_instance_of(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
897  try {
898  assert::is_instance_of<type_t>(value, message, stack_frame);
899  } catch (...) {
900  assert::abort();
901  }
902  }
903 
913  template<typename value1_t, typename value2_t>
914  static void is_less(const value1_t& val1, const value2_t& val2) {is_less(val1, val2, "", xtd::diagnostics::stack_frame::empty());}
925  template<typename value1_t, typename value2_t>
926  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);}
937  template<typename value1_t, typename value2_t>
938  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());}
950  template<typename value1_t, typename value2_t>
951  static void is_less(const value1_t& val1, const value2_t& val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
952  try {
953  assert::is_less(val1, val2, message, stack_frame);
954  } catch (...) {
955  assert::abort();
956  }
957  }
958 
960  static void is_less(const char* val1, const char* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
961 #if defined(__cpp_lib_char8_t)
962  static void is_less(const char8* val1, const char8* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
963 #endif
964  static void is_less(const char16* val1, const char16* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
965  static void is_less(const char32* val1, const char32* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
966  static void is_less(const wchar_t* val1, const wchar_t* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
968 
979  template<typename value1_t, typename value2_t>
980  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());}
992  template<typename value1_t, typename value2_t>
993  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);}
1005  template<typename value1_t, typename value2_t>
1006  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());}
1019  template<typename value1_t, typename value2_t>
1020  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) {
1021  try {
1022  assert::is_less_or_equal(val1, val2, message, stack_frame);
1023  } catch (...) {
1024  assert::abort();
1025  }
1026  }
1027 
1029  static void is_less_or_equal(const char* val1, const char* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1030 #if defined(__cpp_lib_char8_t)
1031  static void is_less_or_equal(const char8* val1, const char8* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1032 #endif
1033  static void is_less_or_equal(const char16* val1, const char16* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1034  static void is_less_or_equal(const char32* val1, const char32* val2, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1035  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);
1037 
1048  static void is_NaN(double value);
1060  static void is_NaN(double value, const xtd::diagnostics::stack_frame& stack_frame);
1072  static void is_NaN(double value, const xtd::ustring& message);
1085  static void is_NaN(double value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1096  static void is_NaN(long double value);
1108  static void is_NaN(long double value, const xtd::diagnostics::stack_frame& stack_frame);
1120  static void is_NaN(long double value, const xtd::ustring& message);
1133  static void is_NaN(long double value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1144  static void is_NaN(float value);
1156  static void is_NaN(float value, const xtd::diagnostics::stack_frame& stack_frame);
1168  static void is_NaN(float value, const xtd::ustring& message);
1181  static void is_NaN(float value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1182 
1193  template<typename value_t>
1194  static void is_negative(const value_t& value) {is_negative(value, "", xtd::diagnostics::stack_frame::empty());}
1206  template<typename value_t>
1207  static void is_negative(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_negative(value, "", stack_frame);}
1219  template<typename value_t>
1220  static void is_negative(const value_t& value, const xtd::ustring& message) {is_negative(value, message, xtd::diagnostics::stack_frame::empty());}
1233  template<typename value_t>
1234  static void is_negative(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1235  try {
1236  assert::is_negative(value, message, stack_frame);
1237  } catch (...) {
1238  assert::abort();
1239  }
1240  }
1241 
1252  template<typename value_t>
1253  static void is_not_empty(const value_t& value) {is_not_empty(value, "", xtd::diagnostics::stack_frame::empty());}
1265  template<typename value_t>
1266  static void is_not_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_empty(value, "", stack_frame);}
1278  template<typename value_t>
1279  static void is_not_empty(const value_t& value, const xtd::ustring& message) {is_not_empty(value, message, xtd::diagnostics::stack_frame::empty());}
1292  template<typename value_t>
1293  static void is_not_empty(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1294  try {
1295  assert::is_not_empty(value, message, stack_frame);
1296  } catch (...) {
1297  assert::abort();
1298  }
1299  }
1300 
1302  template<typename value_t>
1303  static void is_not_empty(const std::initializer_list<value_t>& value) {is_not_empty(value, "", xtd::diagnostics::stack_frame::empty());}
1304  template<typename value_t>
1305  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);}
1306  template<typename value_t>
1307  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());}
1308  template<typename value_t>
1309  static void is_not_empty(const std::initializer_list<value_t>& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1310  try {
1311  assert::is_not_empty(value, message, stack_frame);
1312  } catch (...) {
1313  assert::abort();
1314  }
1315  }
1316  static void is_not_empty(const char* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1317 #if defined(__cpp_lib_char8_t)
1318  static void is_not_empty(const char8* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1319 #endif
1320  static void is_not_empty(const char16* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1321  static void is_not_empty(const char32* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1322  static void is_not_empty(const wchar_t* value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1324 
1334  template<typename type_t, typename value_t>
1335  static void is_not_instance_of(const value_t& value) {is_not_instance_of<type_t>(value, "", xtd::diagnostics::stack_frame::empty());}
1346  template<typename type_t, typename value_t>
1347  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);}
1358  template<typename type_t, typename value_t>
1359  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());}
1371  template<typename type_t, typename value_t>
1372  static void is_not_instance_of(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1373  try {
1374  assert::is_not_instance_of<type_t>(value, message, stack_frame);
1375  } catch (...) {
1376  assert::abort();
1377  }
1378  }
1379 
1391  template<typename pointer_t>
1392  static void is_not_null(const pointer_t* pointer) {is_not_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1405  template<typename pointer_t>
1406  static void is_not_null(const pointer_t* pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_not_null(pointer, "", stack_frame);}
1419  template<typename pointer_t>
1420  static void is_not_null(const pointer_t* pointer, const xtd::ustring& message) {is_not_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1434  template<typename pointer_t>
1435  static void is_not_null(const pointer_t* pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1436  try {
1437  assert::is_not_null(pointer, message, stack_frame);
1438  } catch (...) {
1439  assert::abort();
1440  }
1441  }
1452  template<typename optional_t>
1453  static void is_not_null(const std::optional<optional_t>& opt) {is_not_null(opt, "", xtd::diagnostics::stack_frame::empty());}
1465  template<typename optional_t>
1466  static void is_not_null(const std::optional<optional_t>& opt, const xtd::diagnostics::stack_frame& stack_frame) {is_not_null(opt, "", stack_frame);}
1478  template<typename optional_t>
1479  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());}
1492  template<typename optional_t>
1493  static void is_not_null(const std::optional<optional_t>& opt, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1494  try {
1495  assert::is_not_null(opt, message, stack_frame);
1496  } catch (...) {
1497  assert::abort();
1498  }
1499  }
1510  template<typename pointer_t>
1511  static void is_not_null(const std::unique_ptr<pointer_t>& pointer) {is_not_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1523  template<typename pointer_t>
1524  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);}
1536  template<typename pointer_t>
1537  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());}
1550  template<typename pointer_t>
1551  static void is_not_null(const std::unique_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1552  try {
1553  assert::is_not_null(pointer, message, stack_frame);
1554  } catch (...) {
1555  assert::abort();
1556  }
1557  }
1568  template<typename pointer_t>
1569  static void is_not_null(const std::shared_ptr<pointer_t>& pointer) {is_not_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1581  template<typename pointer_t>
1582  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);}
1594  template<typename pointer_t>
1595  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());}
1608  template<typename pointer_t>
1609  static void is_not_null(const std::shared_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1610  try {
1611  assert::is_not_null(pointer, message, stack_frame);
1612  } catch (...) {
1613  assert::abort();
1614  }
1615  }
1627  template<typename pointer_t>
1628  static void is_not_null(const std::weak_ptr<pointer_t>& pointer) {is_not_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1641  template<typename pointer_t>
1642  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);}
1655  template<typename pointer_t>
1656  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());}
1670  template<typename pointer_t>
1671  static void is_not_null(const std::weak_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1672  try {
1673  assert::is_not_null(pointer, message, stack_frame);
1674  } catch (...) {
1675  assert::abort();
1676  }
1677  }
1686  static void is_not_null(std::nullptr_t pointer);
1696  static void is_not_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame& stack_frame);
1706  static void is_not_null(std::nullptr_t pointer, const xtd::ustring& message);
1717  static void is_not_null(std::nullptr_t pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
1718 
1729  template<typename value_t>
1730  static void is_not_zero(const value_t& value) {is_not_zero(value, "", xtd::diagnostics::stack_frame::empty());}
1742  template<typename value_t>
1743  static void is_not_zero(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_zero(value, "", stack_frame);}
1755  template<typename value_t>
1756  static void is_not_zero(const value_t& value, const xtd::ustring& message) {is_not_zero(value, message, xtd::diagnostics::stack_frame::empty());}
1769  template<typename value_t>
1770  static void is_not_zero(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1771  try {
1772  assert::is_not_zero(value, message, stack_frame);
1773  } catch (...) {
1774  assert::abort();
1775  }
1776  }
1777 
1789  template<typename pointer_t>
1790  static void is_null(const pointer_t* pointer) {is_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1803  template<typename pointer_t>
1804  static void is_null(const pointer_t* pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_null(pointer, "", stack_frame);}
1817  template<typename pointer_t>
1818  static void is_null(const pointer_t* pointer, const xtd::ustring& message) {is_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1832  template<typename pointer_t>
1833  static void is_null(const pointer_t* pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1834  try {
1835  assert::is_null(pointer, message, stack_frame);
1836  } catch (...) {
1837  assert::abort();
1838  }
1839  }
1850  template<typename optional_t>
1851  static void is_null(const std::optional<optional_t>& opt) {is_null(opt, "", xtd::diagnostics::stack_frame::empty());}
1863  template<typename optional_t>
1864  static void is_null(const std::optional<optional_t>& opt, const xtd::diagnostics::stack_frame& stack_frame) {is_null(opt, "", stack_frame);}
1876  template<typename optional_t>
1877  static void is_null(const std::optional<optional_t>& opt, const xtd::ustring& message) {is_null(opt, message, xtd::diagnostics::stack_frame::empty());}
1890  template<typename optional_t>
1891  static void is_null(const std::optional<optional_t>& opt, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1892  try {
1893  assert::is_null(opt, message, stack_frame);
1894  } catch (...) {
1895  assert::abort();
1896  }
1897  }
1908  template<typename pointer_t>
1909  static void is_null(const std::unique_ptr<pointer_t>& pointer) {is_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1921  template<typename pointer_t>
1922  static void is_null(const std::unique_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_null(pointer, "", stack_frame);}
1934  template<typename pointer_t>
1935  static void is_null(const std::unique_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
1948  template<typename pointer_t>
1949  static void is_null(const std::unique_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
1950  try {
1951  assert::is_null(pointer, message, stack_frame);
1952  } catch (...) {
1953  assert::abort();
1954  }
1955  }
1966  template<typename pointer_t>
1967  static void is_null(const std::shared_ptr<pointer_t>& pointer) {is_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
1979  template<typename pointer_t>
1980  static void is_null(const std::shared_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_null(pointer, "", stack_frame);}
1992  template<typename pointer_t>
1993  static void is_null(const std::shared_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
2006  template<typename pointer_t>
2007  static void is_null(const std::shared_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2008  try {
2009  assert::is_null(pointer, message, stack_frame);
2010  } catch (...) {
2011  assert::abort();
2012  }
2013  }
2026  template<typename pointer_t>
2027  static void is_null(const std::weak_ptr<pointer_t>& pointer) {is_null(pointer, "", xtd::diagnostics::stack_frame::empty());}
2041  template<typename pointer_t>
2042  static void is_null(const std::weak_ptr<pointer_t>& pointer, const xtd::diagnostics::stack_frame& stack_frame) {is_null(pointer, "", stack_frame);}
2056  template<typename pointer_t>
2057  static void is_null(const std::weak_ptr<pointer_t>& pointer, const xtd::ustring& message) {is_null(pointer, message, xtd::diagnostics::stack_frame::empty());}
2072  template<typename pointer_t>
2073  static void is_null(const std::weak_ptr<pointer_t>& pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2074  try {
2075  assert::is_null(pointer, message, stack_frame);
2076  } catch (...) {
2077  assert::abort();
2078  }
2079  }
2088  static void is_null(std::nullptr_t pointer);
2098  static void is_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame& stack_frame);
2108  static void is_null(std::nullptr_t pointer, const xtd::ustring& message);
2119  static void is_null(std::nullptr_t pointer, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
2120 
2131  template<typename value_t>
2132  static void is_positive(const value_t& value) {is_positive(value, "", xtd::diagnostics::stack_frame::empty());}
2144  template<typename value_t>
2145  static void is_positive(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_positive(value, "", stack_frame);}
2157  template<typename value_t>
2158  static void is_positive(const value_t& value, const xtd::ustring& message) {is_positive(value, message, xtd::diagnostics::stack_frame::empty());}
2171  template<typename value_t>
2172  static void is_positive(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2173  try {
2174  assert::is_positive(value, message, stack_frame);
2175  } catch (...) {
2176  assert::abort();
2177  }
2178  }
2179 
2190  static void is_true(bool condition);
2202  static void is_true(bool condition, const xtd::diagnostics::stack_frame& stack_frame);
2214  static void is_true(bool condition, const xtd::ustring& message);
2227  static void is_true(bool condition, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
2228 
2239  template<typename value_t>
2240  static void is_zero(const value_t& value) {is_zero(value, "", xtd::diagnostics::stack_frame::empty());}
2252  template<typename value_t>
2253  static void is_zero(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_zero(value, "", stack_frame);}
2265  template<typename value_t>
2266  static void is_zero(const value_t& value, const xtd::ustring& message) {is_zero(value, message, xtd::diagnostics::stack_frame::empty());}
2279  template<typename value_t>
2280  static void is_zero(const value_t& value, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2281  try {
2282  assert::is_zero(value, message, stack_frame);
2283  } catch (...) {
2284  assert::abort();
2285  }
2286  }
2287 
2298  template<typename exception_t>
2299  static void throws(const std::function<void()>& statement) {throws<exception_t>(statement, "", xtd::diagnostics::stack_frame::empty());}
2311  template<typename exception_t>
2312  static void throws(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame) {throws<exception_t>(statement, "", stack_frame);}
2324  template<typename exception_t>
2325  static void throws(const std::function<void()>& statement, const xtd::ustring& message) {throws<exception_t>(statement, message, xtd::diagnostics::stack_frame::empty());}
2338  template<typename exception_t>
2339  static void throws(const std::function<void()>& statement, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
2340  try {
2341  assert::throws<exception_t>(statement, message, stack_frame);
2342  } catch (...) {
2343  assert::abort();
2344  }
2345  }
2346 
2356  static void throws_any(const std::function<void()>& statement);
2367  static void throws_any(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame);
2378  static void throws_any(const std::function<void()>& statement, const xtd::ustring& message);
2390  static void throws_any(const std::function<void()>& statement, const xtd::ustring& message, const xtd::diagnostics::stack_frame& stack_frame);
2392  };
2393  }
2394 }
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 are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that two type are not equal.
Definition: assume.h:277
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message)
Assumes that the pointer is null.
Definition: assume.h:1935
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Assumes that two type are not equal.
Definition: assume.h:289
The base class for assert.
Definition: base_assert.h:29
static void is_not_empty(const value_t &value)
Assumes that collection oes not contain any item.
Definition: assume.h:1253
static void is_not_null(const pointer_t *pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is not null.
Definition: assume.h:1435
static void is_not_null(const std::unique_ptr< pointer_t > &pointer)
Assumes that the pointer is not null.
Definition: assume.h:1511
static void is_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that an object is of the type supplied or a derived type.
Definition: assume.h:871
static void is_null(const pointer_t *pointer)
Asserts that the pointer is null.
Definition: assert.h:1781
static void is_not_null(const std::optional< optional_t > &opt, const xtd::ustring &message)
Assumes that the optional is not std::nullopt.
Definition: assume.h:1479
static void is_not_instance_of(const value_t &value)
Assumes that an object is not of the type supplied or a derived type.
Definition: assume.h:1335
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Assumes that two objects do refer to differents objects.
Definition: assume.h:364
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is not null.
Definition: assume.h:1551
static void is_not_empty(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that collection does not contain any item.
Definition: assume.h:1293
static void is_positive(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that ta condition is positive.
Definition: assume.h:2145
static void is_instance_of(const value_t &value, const xtd::ustring &message)
Assumes that an object is of the type supplied or a derived type.
Definition: assume.h:883
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is null.
Definition: assume.h:2007
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is null.
Definition: assume.h:1949
static void is_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that ta condition is zero.
Definition: assume.h:2253
static void is_not_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is not null.
Definition: assume.h:1406
static void is_null(const std::optional< optional_t > &opt, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the optional is std::nullopt.
Definition: assume.h:1891
static void is_null(const pointer_t *pointer)
Assumes that the pointer is null.
Definition: assume.h:1790
static void is_null(const std::optional< optional_t > &opt)
Assumes that the optional is std::nullopt.
Definition: assume.h:1851
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message)
Assumes that the pointer is not null.
Definition: assume.h:1595
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that two objects do refer to differents objects.
Definition: assume.h:447
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is not null.
Definition: assume.h:1524
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 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_not_empty(const value_t &value)
Asserts that collection oes not contain any item.
Definition: assert.h:1256
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is null.
Definition: assume.h:2042
static void is_not_null(const std::shared_ptr< pointer_t > &pointer)
Assumes that the pointer is not null.
Definition: assume.h:1569
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is not null.
Definition: assume.h:1609
static void contains(const item_t &item, const collection_t &collection, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that collection contains an item.
Definition: assume.h:506
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
static void is_zero(const value_t &value)
Assumes that ta condition is zero.
Definition: assume.h:2240
static void is_not_empty(const value_t &value, const xtd::ustring &message)
Assumes that collection does not contain any item.
Definition: assume.h:1279
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Assumes that the first value is greater than the second value.
Definition: assume.h:749
static void is_empty(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that collection contains an item.
Definition: assume.h:634
The assume class contains a collection of static methods that implement the most common assertions us...
Definition: assume.h:21
static void is_not_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that an object is not of the type supplied or a derived type.
Definition: assume.h:1347
static void is_not_null(const pointer_t *pointer, const xtd::ustring &message)
Assumes that the pointer is not null.
Definition: assume.h:1420
static void is_null(const std::weak_ptr< pointer_t > &pointer)
Assumes that the pointer is null.
Definition: assume.h:2027
static void is_not_null(const pointer_t *pointer)
Assumes that the pointer is not null.
Definition: assume.h:1392
static void is_not_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that collection does not contain any item.
Definition: assume.h:1266
static void is_not_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that ta condition is not zero.
Definition: assume.h:1743
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Assumes that two objects do refer to differents objects.
Definition: assume.h:431
static void is_positive(const value_t &value, const xtd::ustring &message)
Assumes that ta condition is positive.
Definition: assume.h:2158
static void abort()
Abort current test. This is used by the other assert functions.
static void is_zero(const value_t &value, const xtd::ustring &message)
Assumes that ta condition is zero.
Definition: assume.h:2266
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
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
static void is_zero(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that ta condition is zero.
Definition: assume.h:2280
static void is_null(const std::optional< optional_t > &opt, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the optional is std::nullopt.
Definition: assume.h:1864
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that two objects do refer to differents objects.
Definition: assume.h:380
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Assumes that the first value is greater than or equal to the second value.
Definition: assume.h:817
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message)
Assumes that the pointer is null.
Definition: assume.h:2057
static void is_greater(const value1_t &val1, const value2_t &val2)
Assumes that the first value is greater than the second value.
Definition: assume.h:725
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the first value is is_less than or equal to the second value.
Definition: assume.h:993
static void is_negative(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that ta condition is negative.
Definition: assume.h:1234
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that two type are equal.
Definition: assume.h:52
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the first value is greater than the second value.
Definition: assume.h:762
static void is_not_null(const std::optional< optional_t > &opt, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the optional is not std::nullopt.
Definition: assume.h:1466
static void is_not_null(const std::optional< optional_t > &opt)
Assumes that the optional is not std::nullopt.
Definition: assume.h:1453
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 are_not_equal(const expected_t &expected, const actual_t &actual)
Assumes that two type are not equal.
Definition: assume.h:265
static void contains(const item_t &item, const collection_t &collection)
Assumes that collection contains an item.
Definition: assume.h:466
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that two type are not equal.
Definition: assume.h:303
static void is_less_or_equal(const value1_t &val1, const value2_t &val2)
Assumes that the first value is is_less than or equal to the second value.
Definition: assume.h:980
static void is_null(const std::shared_ptr< pointer_t > &pointer)
Assumes that the pointer is null.
Definition: assume.h:1967
static void is_empty(const value_t &value)
Assumes that collection contains an item.
Definition: assume.h:594
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is not null.
Definition: assume.h:1642
static void is_empty(const value_t &value)
Asserts that collection contains an item.
Definition: assert.h:604
static void is_null(const pointer_t *pointer, const xtd::ustring &message)
Assumes that the pointer is null.
Definition: assume.h:1818
static void is_not_zero(const value_t &value)
Assumes that ta condition is not zero.
Definition: assume.h:1730
static void contains(const item_t &item, const collection_t &collection)
Asserts that collection contains an item.
Definition: assert.h:476
static void is_negative(const value_t &value, const xtd::ustring &message)
Assumes that ta condition is negative.
Definition: assume.h:1220
static void are_not_same(const expected_t &expected, const actual_t &actual)
Assumes that two objects do refer to differents objects.
Definition: assume.h:334
static void is_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is null.
Definition: assume.h:2073
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:37
static void is_null(const std::unique_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is null.
Definition: assume.h:1922
static void is_not_null(const std::shared_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is not null.
Definition: assume.h:1582
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_instance_of(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that an object is of the type supplied or a derived type.
Definition: assume.h:896
static void is_not_instance_of(const value_t &value, const xtd::ustring &message)
Assumes that an object is not of the type supplied or a derived type.
Definition: assume.h:1359
static void is_not_zero(const value_t &value, const xtd::ustring &message)
Assumes that ta condition is not zero.
Definition: assume.h:1756
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::ustring &message)
Assumes that the pointer is null.
Definition: assume.h:1993
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the first value is is_less than the second value.
Definition: assume.h:951
Contains xtd::tunit::assert class.
static void is_empty(const value_t &value, const xtd::ustring &message)
Assumes that collection contains an item.
Definition: assume.h:620
static void is_negative(const value_t &value)
Assumes that ta condition is negative.
Definition: assume.h:1194
static void is_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that collection contains an item.
Definition: assume.h:607
static void is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Assumes that the first value is is_less than or equal to the second value.
Definition: assume.h:1006
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message)
Assumes that the pointer is not null.
Definition: assume.h:1656
static void is_greater(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the first value is greater than the second value.
Definition: assume.h:737
static void is_positive(const value_t &value)
Assumes that ta condition is positive.
Definition: assume.h:2132
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the first value is is_less than the second value.
Definition: assume.h:926
static void is_positive(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that ta condition is positive.
Definition: assume.h:2172
static void is_not_null(const std::weak_ptr< pointer_t > &pointer)
Assumes that the pointer is not null.
Definition: assume.h:1628
static void is_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is null.
Definition: assume.h:1804
static void are_same(const expected_t &expected, const actual_t &actual)
Assumes that two objects do refer to differents objects.
Definition: assume.h:401
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message)
Assumes that two type are equal.
Definition: assume.h:64
static void is_not_null(const std::optional< optional_t > &opt, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the optional is not std::nullopt.
Definition: assume.h:1493
char32_t char32
Represents a 32-bit unicode character.
Definition: types.h:85
static void is_negative(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that ta condition is negative.
Definition: assume.h:1207
static void are_not_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that two objects do refer to differents objects.
Definition: assume.h:349
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)
Assumes that the first value is is_less than or equal to the second value.
Definition: assume.h:1020
static void is_null(const std::optional< optional_t > &opt, const xtd::ustring &message)
Assumes that the optional is std::nullopt.
Definition: assume.h:1877
static void is_not_null(const std::weak_ptr< pointer_t > &pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is not null.
Definition: assume.h:1671
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2)
Assumes that the first value is greater than or equal to the second value.
Definition: assume.h:791
static void is_negative(const value_t &value)
Asserts that ta condition is negative.
Definition: assert.h:1198
static void is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the first value is greater than or equal to the second value.
Definition: assume.h:804
static void is_less(const value1_t &val1, const value2_t &val2, const xtd::ustring &message)
Assumes that the first value is is_less than the second value.
Definition: assume.h:938
static void contains(const item_t &item, const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that collection contains an item.
Definition: assume.h:479
static void is_less(const value1_t &val1, const value2_t &val2)
Assumes that the first value is is_less than the second value.
Definition: assume.h:914
static void is_not_zero(const value_t &value)
Asserts that ta condition is not zero.
Definition: assert.h:1722
static void is_null(const std::unique_ptr< pointer_t > &pointer)
Assumes that the pointer is null.
Definition: assume.h:1909
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)
Assumes that the first value is greater than or equal to the second value.
Definition: assume.h:831
char8_t char8
Represents a 8-bit unicode character.
Definition: types.h:62
static void is_not_instance_of(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that an object is not of the type supplied or a derived type.
Definition: assume.h:1372
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that two type are equal.
Definition: assume.h:77
char16_t char16
Represents a 16-bit unicode character.
Definition: types.h:74
static void contains(const item_t &item, const collection_t &collection, const xtd::ustring &message)
Assumes that collection contains an item.
Definition: assume.h:492
static void are_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that two objects do refer to differents objects.
Definition: assume.h:416
static void is_not_null(const std::unique_ptr< pointer_t > &pointer, const xtd::ustring &message)
Assumes that the pointer is not null.
Definition: assume.h:1537
static void is_not_zero(const value_t &value, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that ta condition is not zero.
Definition: assume.h:1770
static void is_null(const pointer_t *pointer, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is null.
Definition: assume.h:1833
static void is_instance_of(const value_t &value)
Assumes that an object is of the type supplied or a derived type.
Definition: assume.h:859
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_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 are_equal(const expected_t &expected, const actual_t &actual)
Assumes that two type are equal.
Definition: assume.h:40
static void is_null(const std::shared_ptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame)
Assumes that the pointer is null.
Definition: assume.h:1980