xtd 1.0.0
Loading...
Searching...
No Matches
assume.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "assert.hpp"
6
8namespace xtd {
10 namespace tunit {
21 class tunit_export_ assume final : private base_assert {
22 public:
24 assume() = delete;
26
28
40 template<typename expected_t, typename actual_t>
41 static auto are_equal(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {are_equal(expected, actual, xtd::string::empty_string, stack_frame);}
53 template<typename expected_t, typename actual_t>
54 static auto are_equal(const expected_t& expected, const actual_t& actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
55 try {
56 assert::are_equal(expected, actual, message, stack_frame);
57 } catch (...) {
59 }
60 }
61
63 static auto are_equal(const char* expected, const char* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
64 static auto are_equal(const char8* expected, const char8* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
65 static auto are_equal(const char16* expected, const char16* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
66 static auto are_equal(const char32* expected, const char32* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
67 static auto are_equal(const wchar_t* expected, const wchar_t* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
68 static auto are_equal(float expected, float actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
69 static auto are_equal(double expected, double actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
70 static auto are_equal(long double expected, long double actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
72
85 static auto are_equal(float expected, float actual, float tolerance, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
99 static auto are_equal(float expected, float actual, float tolerance, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
112 static auto are_equal(double expected, double actual, double tolerance, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
126 static auto are_equal(double expected, double actual, double tolerance, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
139 static auto are_equal(long double expected, long double actual, long double tolerance, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
153 static auto are_equal(long double expected, long double actual, long double tolerance, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
154
165 template<typename expected_t, typename actual_t>
166 static auto are_not_equal(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {are_not_equal(expected, actual, xtd::string::empty_string, stack_frame);}
167
179 template<typename expected_t, typename actual_t>
180 static auto are_not_equal(const expected_t& expected, const actual_t& actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
181 try {
182 assert::are_not_equal(expected, actual, message, stack_frame);
183 } catch (...) {
185 }
186 }
187
189 static auto are_not_equal(const char* expected, const char* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
190 static auto are_not_equal(const char8* expected, const char8* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
191 static auto are_not_equal(const char16* expected, const char16* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
192 static auto are_not_equal(const char32* expected, const char32* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
193 static auto are_not_equal(const wchar_t* expected, const wchar_t* actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
195
209 template<typename expected_t, typename actual_t>
210 static auto are_not_same(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {are_not_same(expected, actual, xtd::string::empty_string, stack_frame);}
225 template<typename expected_t, typename actual_t>
226 static auto are_not_same(const expected_t& expected, const actual_t& actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
227 try {
228 assert::are_not_same(expected, actual, message, stack_frame);
229 } catch (...) {
231 }
232 }
233
247 template<typename expected_t, typename actual_t>
248 static auto are_same(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {are_same(expected, actual, xtd::string::empty_string, stack_frame);}
263 template<typename expected_t, typename actual_t>
264 static auto are_same(const expected_t& expected, const actual_t& actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
265 try {
266 assert::are_same(expected, actual, message, stack_frame);
267 } catch (...) {
269 }
270 }
271
283 template<typename item_t, typename collection_t>
284 static auto contains(const item_t& item, const collection_t& collection, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {contains(item, collection, xtd::string::empty_string, stack_frame);}
297 template<typename item_t, typename collection_t>
298 static auto contains(const item_t& item, const collection_t& collection, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
299 try {
300 assert::contains(item, collection, message, stack_frame);
301 } catch (...) {
303 }
304 }
305
307 template<typename item_t, typename value_t>
308 static auto contains(const item_t& item, const std::initializer_list<value_t>& values, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {contains(item, values, xtd::string::empty_string, stack_frame);}
309 template<typename item_t, typename value_t>
310 static auto contains(const item_t& item, const std::initializer_list<value_t>& values, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
311 try {
312 assert::contains(item, values, message, stack_frame);
313 } catch (...) {
314 assert::abort();
315 }
316 }
317 static auto contains(char item, const char* values, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
318 static auto contains(char8 item, const char8* values, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
319 static auto contains(char16 item, const char16* values, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
320 static auto contains(char32 item, const char32* values, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
321 static auto contains(wchar_t item, const wchar_t* values, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
323
334 static auto does_not_throw(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
346 static auto does_not_throw(const std::function<void()>& statement, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
347
359 template<typename value_t>
360 static auto is_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_empty(value, xtd::string::empty_string, stack_frame);}
373 template<typename value_t>
374 static auto is_empty(const value_t& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
375 try {
376 assert::is_empty(value, message, stack_frame);
377 } catch (...) {
379 }
380 }
381
383 template<typename value_t>
384 static auto is_empty(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_empty(value, xtd::string::empty_string, stack_frame);}
385 template<typename value_t>
386 static auto is_empty(const std::initializer_list<value_t>& values, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
387 try {
388 assert::is_empty(values, message, stack_frame);
389 } catch (...) {
390 assert::abort();
391 }
392 }
393 static auto is_empty(const char* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
394 static auto is_empty(const char8* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
395 static auto is_empty(const char16* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
396 static auto is_empty(const char32* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
397 static auto is_empty(const wchar_t* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
399
411 static auto is_false(bool condition, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
424 static auto is_false(bool condition, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
425
436 template<typename value1_t, typename value2_t>
437 static auto is_greater(const value1_t& val1, const value2_t& val2, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_greater(val1, val2, xtd::string::empty_string, stack_frame);}
449 template<typename value1_t, typename value2_t>
450 static auto is_greater(const value1_t& val1, const value2_t& val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
451 try {
452 assert::is_greater(val1, val2, message, stack_frame);
453 } catch (...) {
455 }
456 }
457
459 static auto is_greater(const char* val1, const char* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
460 static auto is_greater(const char8* val1, const char8* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
461 static auto is_greater(const char16* val1, const char16* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
462 static auto is_greater(const char32* val1, const char32* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
463 static auto is_greater(const wchar_t* val1, const wchar_t* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
465
477 template<typename value1_t, typename value2_t>
478 static auto is_greater_or_equal(const value1_t& val1, const value2_t& val2, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_greater_or_equal(val1, val2, xtd::string::empty_string, stack_frame);}
491 template<typename value1_t, typename value2_t>
492 static auto is_greater_or_equal(const value1_t& val1, const value2_t& val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
493 try {
494 assert::is_greater_or_equal(val1, val2, message, stack_frame);
495 } catch (...) {
497 }
498 }
499
501 static auto is_greater_or_equal(const char* val1, const char* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
502 static auto is_greater_or_equal(const char8* val1, const char8* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
503 static auto is_greater_or_equal(const char16* val1, const char16* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
504 static auto is_greater_or_equal(const char32* val1, const char32* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
505 static auto is_greater_or_equal(const wchar_t* val1, const wchar_t* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
507
518 template<typename type_t, typename value_t>
519 static auto is_instance_of(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_instance_of<type_t>(value, xtd::string::empty_string, stack_frame);}
531 template<typename type_t, typename value_t>
532 static auto is_instance_of(const value_t& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
533 try {
534 assert::is_instance_of<type_t>(value, message, stack_frame);
535 } catch (...) {
537 }
538 }
539
550 template<typename value1_t, typename value2_t>
551 static auto is_less(const value1_t& val1, const value2_t& val2, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_less(val1, val2, xtd::string::empty_string, stack_frame);}
563 template<typename value1_t, typename value2_t>
564 static auto is_less(const value1_t& val1, const value2_t& val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
565 try {
566 assert::is_less(val1, val2, message, stack_frame);
567 } catch (...) {
569 }
570 }
571
573 static auto is_less(const char* val1, const char* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
574 static auto is_less(const char8* val1, const char8* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
575 static auto is_less(const char16* val1, const char16* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
576 static auto is_less(const char32* val1, const char32* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
577 static auto is_less(const wchar_t* val1, const wchar_t* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
579
591 template<typename value1_t, typename value2_t>
592 static auto is_less_or_equal(const value1_t& val1, const value2_t& val2, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_less_or_equal(val1, val2, xtd::string::empty_string, stack_frame);}
605 template<typename value1_t, typename value2_t>
606 static auto is_less_or_equal(const value1_t& val1, const value2_t& val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
607 try {
608 assert::is_less_or_equal(val1, val2, message, stack_frame);
609 } catch (...) {
611 }
612 }
613
615 static auto is_less_or_equal(const char* val1, const char* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
616 static auto is_less_or_equal(const char8* val1, const char8* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
617 static auto is_less_or_equal(const char16* val1, const char16* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
618 static auto is_less_or_equal(const char32* val1, const char32* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
619 static auto is_less_or_equal(const wchar_t* val1, const wchar_t* val2, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
621
633 static auto is_NaN(double value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
646 static auto is_NaN(double value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
658 static auto is_NaN(long double value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
671 static auto is_NaN(long double value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
683 static auto is_NaN(float value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
696 static auto is_NaN(float value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
697
709 template<typename value_t>
710 static auto is_negative(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_negative(value, xtd::string::empty_string, stack_frame);}
723 template<typename value_t>
724 static auto is_negative(const value_t& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
725 try {
726 assert::is_negative(value, message, stack_frame);
727 } catch (...) {
729 }
730 }
731
743 template<typename value_t>
744 static auto is_not_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_not_empty(value, xtd::string::empty_string, stack_frame);}
757 template<typename value_t>
758 static auto is_not_empty(const value_t& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
759 try {
760 assert::is_not_empty(value, message, stack_frame);
761 } catch (...) {
763 }
764 }
765
767 template<typename value_t>
768 static auto is_not_empty(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_not_empty(value, xtd::string::empty_string, stack_frame);}
769 template<typename value_t>
770 static auto is_not_empty(const std::initializer_list<value_t>& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
771 try {
772 assert::is_not_empty(value, message, stack_frame);
773 } catch (...) {
774 assert::abort();
775 }
776 }
777 static auto is_not_empty(const char* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
778 static auto is_not_empty(const char8* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
779 static auto is_not_empty(const char16* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
780 static auto is_not_empty(const char32* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
781 static auto is_not_empty(const wchar_t* value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
783
794 template<typename type_t, typename value_t>
795 static auto is_not_instance_of(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_not_instance_of<type_t>(value, xtd::string::empty_string, stack_frame);}
807 template<typename type_t, typename value_t>
808 static auto is_not_instance_of(const value_t& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
809 try {
810 assert::is_not_instance_of<type_t>(value, message, stack_frame);
811 } catch (...) {
813 }
814 }
815
828 template<typename pointer_t>
843 template<typename pointer_t>
844 static auto is_not_null(const pointer_t* pointer, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
845 try {
846 assert::is_not_null(pointer, message, stack_frame);
847 } catch (...) {
849 }
850 }
851
862 template<typename optional_t>
863 static auto is_not_null(const std::optional<optional_t>& opt, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_not_null(opt, xtd::string::empty_string, stack_frame);}
876 template<typename optional_t>
877 static auto is_not_null(const std::optional<optional_t>& opt, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
878 try {
879 assert::is_not_null(opt, message, stack_frame);
880 } catch (...) {
882 }
883 }
884
895 template<typename pointer_t>
909 template<typename pointer_t>
911 try {
912 assert::is_not_null(pointer, message, stack_frame);
913 } catch (...) {
915 }
916 }
917
928 template<typename pointer_t>
942 template<typename pointer_t>
944 try {
945 assert::is_not_null(pointer, message, stack_frame);
946 } catch (...) {
948 }
949 }
950
962 template<typename pointer_t>
977 template<typename pointer_t>
979 try {
980 assert::is_not_null(pointer, message, stack_frame);
981 } catch (...) {
983 }
984 }
985
994 static auto is_not_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
1005 static auto is_not_null(std::nullptr_t pointer, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
1006
1018 template<typename value_t>
1019 static auto is_not_zero(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_not_zero(value, xtd::string::empty_string, stack_frame);}
1032 template<typename value_t>
1033 static auto is_not_zero(const value_t& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
1034 try {
1035 assert::is_not_zero(value, message, stack_frame);
1036 } catch (...) {
1037 assert::abort();
1038 }
1039 }
1040
1053 template<typename pointer_t>
1054 static auto is_null(const pointer_t* pointer, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_null(pointer, xtd::string::empty_string, stack_frame);}
1068 template<typename pointer_t>
1069 static auto is_null(const pointer_t* pointer, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
1070 try {
1071 assert::is_null(pointer, message, stack_frame);
1072 } catch (...) {
1073 assert::abort();
1074 }
1075 }
1076
1087 template<typename optional_t>
1088 static auto is_null(const std::optional<optional_t>& opt, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_null(opt, xtd::string::empty_string, stack_frame);}
1101 template<typename optional_t>
1102 static auto is_null(const std::optional<optional_t>& opt, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
1103 try {
1104 assert::is_null(opt, message, stack_frame);
1105 } catch (...) {
1106 assert::abort();
1107 }
1108 }
1109
1120 template<typename pointer_t>
1134 template<typename pointer_t>
1136 try {
1137 assert::is_null(pointer, message, stack_frame);
1138 } catch (...) {
1139 assert::abort();
1140 }
1141 }
1142
1153 template<typename pointer_t>
1167 template<typename pointer_t>
1169 try {
1170 assert::is_null(pointer, message, stack_frame);
1171 } catch (...) {
1172 assert::abort();
1173 }
1174 }
1175
1188 template<typename pointer_t>
1204 template<typename pointer_t>
1206 try {
1207 assert::is_null(pointer, message, stack_frame);
1208 } catch (...) {
1209 assert::abort();
1210 }
1211 }
1212
1221 static auto is_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
1232 static auto is_null(std::nullptr_t pointer, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
1233
1245 template<typename value_t>
1246 static auto is_positive(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_positive(value, xtd::string::empty_string, stack_frame);}
1259 template<typename value_t>
1260 static auto is_positive(const value_t& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
1261 try {
1262 assert::is_positive(value, message, stack_frame);
1263 } catch (...) {
1264 assert::abort();
1265 }
1266 }
1267
1279 static auto is_true(bool condition, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
1292 static auto is_true(bool condition, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
1293
1305 template<typename value_t>
1306 static auto is_zero(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {is_zero(value, xtd::string::empty_string, stack_frame);}
1319 template<typename value_t>
1320 static auto is_zero(const value_t& value, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
1321 try {
1322 assert::is_zero(value, message, stack_frame);
1323 } catch (...) {
1324 assert::abort();
1325 }
1326 }
1327
1339 template<typename exception_t>
1340 static auto throws(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {throws<exception_t>(statement, xtd::string::empty_string, stack_frame);}
1353 template<typename exception_t>
1354 static auto throws(const std::function<void()>& statement, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void {
1355 try {
1356 assert::throws<exception_t>(statement, message, stack_frame);
1357 } catch (...) {
1358 assert::abort();
1359 }
1360 }
1361
1372 static auto throws_any(const std::function<void()>& statement, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
1384 static auto throws_any(const std::function<void()>& statement, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) -> void;
1386 };
1387 }
1388}
static const basic_string empty_string
Definition basic_string.hpp:111
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.hpp:46
static auto current(const xtd::diagnostics::source_location &value=xtd::diagnostics::source_location::current()) noexcept -> xtd::diagnostics::stack_frame
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
static auto is_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that collection contains an item.
Definition assert.hpp:351
static auto is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that the first value is greater than or equal to the second value.
Definition assert.hpp:460
static auto is_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that the pointer is null.
Definition assert.hpp:994
static auto throws(const std::function< void()> &statement, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that the statement throws a particular exception when called.
Definition assert.hpp:1257
static auto is_not_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that the pointer is not null.
Definition assert.hpp:789
static auto is_positive(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that ta condition is positive.
Definition assert.hpp:1169
static auto is_not_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that collection does not contain any item.
Definition assert.hpp:712
static auto is_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that ta condition is zero.
Definition assert.hpp:1226
static auto is_negative(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that ta condition is negative.
Definition assert.hpp:681
static auto are_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that two objects do refer to differents objects.
Definition assert.hpp:246
static auto are_not_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that two objects do refer to differents objects.
Definition assert.hpp:211
static auto is_greater(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that the first value is greater than the second value.
Definition assert.hpp:422
static auto is_not_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that an object is not of the type supplied or a derived type.
Definition assert.hpp:757
static auto is_not_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that ta condition is not zero.
Definition assert.hpp:962
static auto is_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that an object is of the type supplied or a derived type.
Definition assert.hpp:498
static auto contains(const item_t &item, const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that collection contains an item.
Definition assert.hpp:279
static auto is_less(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that the first value is is_less than the second value.
Definition assert.hpp:528
static auto is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that the first value is is_less than or equal to the second value.
Definition assert.hpp:566
static auto are_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that two type are equal.
Definition assert.hpp:50
static auto are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Asserts that two type are not equal.
Definition assert.hpp:171
The assume class contains a collection of static methods that implement the most common assertions us...
Definition assume.hpp:21
static auto are_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are equal.
Definition assume.hpp:41
static auto are_not_same(const expected_t &expected, const actual_t &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two objects do refer to differents objects.
Definition assume.hpp:226
static auto is_null(const xtd::uptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
Definition assume.hpp:1135
static auto is_null(const xtd::sptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
Definition assume.hpp:1168
static auto are_same(const expected_t &expected, const actual_t &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two objects do refer to differents objects.
Definition assume.hpp:264
static auto is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the first value is greater than or equal to the second value.
Definition assume.hpp:492
static auto is_NaN(double value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
that a value is NaN.
static auto is_not_null(const xtd::uptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
Definition assume.hpp:910
static auto is_null(const xtd::sptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
Definition assume.hpp:1154
static auto is_NaN(float value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that a value is NaN.
static auto is_not_null(const std::optional< optional_t > &opt, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the optional is not std::nullopt.
Definition assume.hpp:877
static auto is_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that an object is of the type supplied or a derived type.
Definition assume.hpp:519
static auto are_equal(long double expected, long double actual, long double tolerance, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are equal.
static auto are_equal(const expected_t &expected, const actual_t &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are equal.
Definition assume.hpp:54
static auto are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are not equal.
Definition assume.hpp:166
static auto is_negative(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that ta condition is negative.
Definition assume.hpp:710
static auto is_not_null(const xtd::sptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
Definition assume.hpp:929
static auto is_not_empty(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that collection does not contain any item.
Definition assume.hpp:758
static auto does_not_throw(const std::function< void()> &statement, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the staement does not throw an exception.
static auto is_false(bool condition, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that a condition is false.
static auto is_true(bool condition, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that a condition is true.
static auto contains(const item_t &item, const collection_t &collection, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that collection contains an item.
Definition assume.hpp:298
static auto is_NaN(long double value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
that a value is NaN.
static auto are_equal(float expected, float actual, float tolerance, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are equal.
static auto are_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two objects do refer to differents objects.
Definition assume.hpp:248
static auto is_not_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
static auto is_null(const std::optional< optional_t > &opt, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the optional is std::nullopt.
Definition assume.hpp:1088
static auto is_not_null(const std::optional< optional_t > &opt, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the optional is not std::nullopt.
Definition assume.hpp:863
static auto is_greater_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the first value is greater than or equal to the second value.
Definition assume.hpp:478
static auto is_positive(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that ta condition is positive.
Definition assume.hpp:1260
static auto is_null(const xtd::uptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
Definition assume.hpp:1121
static auto are_not_same(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two objects do refer to differents objects.
Definition assume.hpp:210
static auto is_not_null(const xtd::sptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
Definition assume.hpp:943
static auto is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the first value is is_less than or equal to the second value.
Definition assume.hpp:606
static auto is_not_null(const xtd::wptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
Definition assume.hpp:978
static auto is_NaN(long double value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that a value is NaN.
static auto is_less_or_equal(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the first value is is_less than or equal to the second value.
Definition assume.hpp:592
static auto is_zero(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that ta condition is zero.
Definition assume.hpp:1320
static auto is_true(bool condition, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that a condition is true.
static auto is_null(const pointer_t *pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
Definition assume.hpp:1069
static auto is_null(std::nullptr_t pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
static auto is_null(const std::optional< optional_t > &opt, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the optional is std::nullopt.
Definition assume.hpp:1102
static auto is_less(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the first value is is_less than the second value.
Definition assume.hpp:551
static auto is_not_zero(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that ta condition is not zero.
Definition assume.hpp:1033
static auto is_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
Definition assume.hpp:1054
static auto contains(const item_t &item, const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that collection contains an item.
Definition assume.hpp:284
static auto is_instance_of(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that an object is of the type supplied or a derived type.
Definition assume.hpp:532
static auto are_equal(long double expected, long double actual, long double tolerance, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are equal.
static auto is_positive(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that ta condition is positive.
Definition assume.hpp:1246
static auto is_not_null(const xtd::uptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
Definition assume.hpp:896
static auto is_NaN(float value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
that a value is NaN.
static auto is_greater(const value1_t &val1, const value2_t &val2, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the first value is greater than the second value.
Definition assume.hpp:450
static auto is_null(const xtd::wptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
Definition assume.hpp:1189
static auto is_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that collection contains an item.
Definition assume.hpp:360
static auto is_not_null(std::nullptr_t pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
static auto is_empty(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that collection contains an item.
Definition assume.hpp:374
static auto is_negative(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that ta condition is negative.
Definition assume.hpp:724
static auto is_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that ta condition is zero.
Definition assume.hpp:1306
static auto is_not_instance_of(const value_t &value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that an object is not of the type supplied or a derived type.
Definition assume.hpp:808
static auto throws_any(const std::function< void()> &statement, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the staement does not throw an exception.
static auto is_not_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that collection does not contain any item.
Definition assume.hpp:744
static auto is_null(std::nullptr_t pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
static auto are_equal(double expected, double actual, double tolerance, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are equal.
static auto is_not_null(const xtd::wptr< pointer_t > &pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
Definition assume.hpp:963
static auto does_not_throw(const std::function< void()> &statement, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the staement does not throw an exception.
static auto are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are not equal.
Definition assume.hpp:180
static auto is_greater(const value1_t &val1, const value2_t &val2, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the first value is greater than the second value.
Definition assume.hpp:437
static auto are_equal(double expected, double actual, double tolerance, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are equal.
static auto throws_any(const std::function< void()> &statement, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the staement does not throw an exception.
static auto is_less(const value1_t &val1, const value2_t &val2, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the first value is is_less than the second value.
Definition assume.hpp:564
static auto is_not_null(const pointer_t *pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
Definition assume.hpp:844
static auto is_not_zero(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that ta condition is not zero.
Definition assume.hpp:1019
static auto is_not_instance_of(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that an object is not of the type supplied or a derived type.
Definition assume.hpp:795
static auto is_not_null(const pointer_t *pointer, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is not null.
Definition assume.hpp:829
static auto are_equal(float expected, float actual, float tolerance, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that two type are equal.
static auto is_false(bool condition, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that a condition is false.
static auto is_null(const xtd::wptr< pointer_t > &pointer, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the pointer is null.
Definition assume.hpp:1205
static auto is_NaN(double value, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that a value is NaN.
static auto throws(const std::function< void()> &statement, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Assumes that the statement throws a particular exception when called.
Definition assume.hpp:1340
The base class for assert.
Definition base_assert.hpp:33
static auto abort(const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
Abort current test. This is used by the other assert functions.
#define tunit_export_
Define shared library export.
Definition tunit_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:26
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
std::weak_ptr< type_t > wptr
The xtd::uptr object is a weak pointer.
Definition wptr.hpp:17
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:23
The tunit namespace contains a unit test library.
Definition abort_error.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
const type_t * pointer
Represents the read_only_span pointer type.
Definition read_only_span.hpp:63
constexpr auto is_empty() const noexcept -> bool
Returns a value that indicates whether the current xtd::read_only_span <type_t> is empty.
Definition read_only_span.hpp:209
Contains xtd::tunit::assert class.