xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
collection_assume.h
Go to the documentation of this file.
1 #pragma once
4 #include "assume.h"
5 #include "collection_assert.h"
6 
8 namespace xtd {
10  namespace tunit {
15  class collection_assume final : private base_assert {
16  public:
18  collection_assume() = delete;
20 
32  template<typename TExpected, typename TCollection>
33  static void all_items_are_instances_of(const TCollection& collection) {all_items_are_instances_of<TExpected>(collection, "", line_info());}
34 
46  template<typename TExpected, typename TCollection>
47  static void all_items_are_instances_of(const TCollection& collection, const std::string& message) {all_items_are_instances_of<TExpected>(collection, message, line_info());}
48 
60  template<typename TExpected, typename TCollection>
61  static void all_items_are_instances_of(const TCollection& collection, const xtd::tunit::line_info& line_info) {all_items_are_instances_of<TExpected>(collection, "", line_info);}
62 
74  template<typename TExpected, typename TCollection>
75  static void all_items_are_instances_of(const TCollection& collection, const std::string& message, const xtd::tunit::line_info& line_info) {
76  try {
77  collection_assert::all_items_are_instances_of<TExpected>(collection, message, line_info);
78  } catch(...) {
79  assert::abort();
80  }
81  }
82 
84  template<typename TExpected, typename TItem>
85  static void all_items_are_instances_of(const std::initializer_list<TItem>& collection) {all_items_are_instances_of<TExpected>(collection, "", line_info());}
86  template<typename TExpected, typename TItem>
87  static void all_items_are_instances_of(const std::initializer_list<TItem>& collection, const std::string& message) {all_items_are_instances_of<TExpected>(collection, message, line_info());}
88  template<typename TExpected, typename TItem>
89  static void all_items_are_instances_of(const std::initializer_list<TItem>& collection, const xtd::tunit::line_info& line_info) {all_items_are_instances_of<TExpected>(collection, "", line_info);}
90  template<typename TExpected, typename TItem>
91  static void all_items_are_instances_of(const std::initializer_list<TItem>& collection, const std::string& message, const xtd::tunit::line_info& line_info) {
92  try {
93  collection_assert::all_items_are_instances_of<TExpected>(collection, message, line_info);
94  } catch(...) {
95  assert::abort();
96  }
97  }
99 
113  template<typename TCollection>
114  static void all_items_are_not_null(const TCollection& collection) {all_items_are_not_null(collection, "", line_info());}
115 
129  template<typename TCollection>
130  static void all_items_are_not_null(const TCollection& collection, const std::string& message) {all_items_are_not_null(collection, message, line_info());}
131 
145  template<typename TCollection>
146  static void all_items_are_not_null(const TCollection& collection, const xtd::tunit::line_info& line_info) {all_items_are_instances_of(collection, "", line_info);}
147 
161  template<typename TCollection>
162  static void all_items_are_not_null(const TCollection& collection, const std::string& message, const xtd::tunit::line_info& line_info) {
163  try {
164  collection_assert::all_items_are_not_null(collection, message, line_info);
165  } catch(...) {
166  assert::abort();
167  }
168  }
169 
171  template<typename TItem>
172  static void all_items_are_not_null(const std::initializer_list<TItem>& collection) {all_items_are_not_null(collection, "", line_info());}
173  template<typename TItem>
174  static void all_items_are_not_null(const std::initializer_list<TItem>& collection, const std::string& message) {all_items_are_not_null(collection, message, line_info());}
175  template<typename TItem>
176  static void all_items_are_not_null(const std::initializer_list<TItem>& collection, const xtd::tunit::line_info& line_info) {all_items_are_instances_of(collection, "", line_info);}
177  template<typename TItem>
178  static void all_items_are_not_null(const std::initializer_list<TItem>& collection, const std::string& message, const xtd::tunit::line_info& line_info) {
179  try {
180  collection_assert::all_items_are_not_null(collection, message, line_info);
181  } catch(...) {
182  assert::abort();
183  }
184  }
186 
199  template<typename TCollection>
200  static void all_items_are_unique(const TCollection& collection) {all_items_are_unique(collection, "", line_info());}
201 
214  template<typename TCollection>
215  static void all_items_are_unique(const TCollection& collection, const std::string& message) {all_items_are_unique(collection, message, line_info());}
216 
229  template<typename TCollection>
230  static void all_items_are_unique(const TCollection& collection, const xtd::tunit::line_info& line_info) {all_items_are_unique(collection, "", line_info);}
231 
244  template<typename TCollection>
245  static void all_items_are_unique(const TCollection& collection, const std::string& message, const xtd::tunit::line_info& line_info) {
246  try {
247  collection_assert::all_items_are_unique(collection, message, line_info);
248  } catch(...) {
249  assert::abort();
250  }
251  }
252 
254  template<typename TItem>
255  static void all_items_are_unique(const std::initializer_list<TItem>& collection) {all_items_are_unique(collection, "", line_info());}
256  template<typename TItem>
257  static void all_items_are_unique(const std::initializer_list<TItem>& collection, const xtd::tunit::line_info& line_info) {all_items_are_unique(collection, "", line_info);}
258  template<typename TItem>
259  static void all_items_are_unique(const std::initializer_list<TItem>& collection, const std::string& message) {all_items_are_unique(collection, message, line_info());}
260  template<typename TItem>
261  static void all_items_are_unique(const std::initializer_list<TItem>& collection, const std::string& message, const xtd::tunit::line_info& line_info) {
262  try {
263  collection_assert::all_items_are_unique(collection, message, line_info);
264  } catch(...) {
265  assert::abort();
266  }
267  }
269 
281  template<typename TExpected, typename TAcutal>
282  static void are_equal(const TExpected& expected, const TAcutal& actual) {are_equal(expected, actual, "", line_info());}
283 
295  template<typename TExpected, typename TAcutal>
296  static void are_equal(const TExpected& expected, const TAcutal& actual, const std::string& message) {are_equal(expected, actual, message, line_info());}
297 
309  template<typename TExpected, typename TAcutal>
310  static void are_equal(const TExpected& expected, const TAcutal& actual, const xtd::tunit::line_info& line_info) {are_equal(expected, actual, "", line_info);}
311 
323  template<typename TExpected, typename TAcutal>
324  static void are_equal(const TExpected& expected, const TAcutal& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
325  try {
326  collection_assert::are_equal(expected, actual, message, line_info);
327  } catch(...) {
328  assert::abort();
329  }
330  }
331 
333  template<typename TItem>
334  static void are_equal(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual) {are_equal(expected, actual, "", line_info());}
335  template<typename TItem>
336  static void are_equal(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {are_equal(expected, actual, "", line_info);}
337  template<typename TItem>
338  static void are_equal(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const std::string& message) {are_equal(expected, actual, message, line_info());}
339  template<typename TItem>
340  static void are_equal(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
341  try {
342  collection_assert::are_equal(expected, actual, message, line_info);
343  } catch(...) {
344  assert::abort();
345  }
346  }
347 
349  template<typename TCollection, typename TItem>
350  static void are_equal(const TCollection& expected, const std::initializer_list<TItem>& actual) {are_equal(expected, actual, "", line_info());}
351  template<typename TCollection, typename TItem>
352  static void are_equal(const TCollection& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {are_equal(expected, actual, "", line_info);}
353  template<typename TCollection, typename TItem>
354  static void are_equal(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message) {are_equal(expected, actual, message, line_info());}
355  template<typename TCollection, typename TItem>
356  static void are_equal(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
357  try {
358  collection_assert::are_equal(expected, actual, message, line_info);
359  } catch(...) {
360  assert::abort();
361  }
362  }
363 
365  template<typename TItem, typename TCollection>
366  static void are_equal(const std::initializer_list<TItem>& expected, const TCollection& actual) {are_equal(expected, actual, "", line_info());}
367  template<typename TItem, typename TCollection>
368  static void are_equal(const std::initializer_list<TItem>& expected, const TCollection& actual, const xtd::tunit::line_info& line_info) {are_equal(expected, actual, "", line_info);}
369  template<typename TItem, typename TCollection>
370  static void are_equal(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message) {are_equal(expected, actual, message, line_info());}
371  template<typename TItem, typename TCollection>
372  static void are_equal(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
373  try {
374  collection_assert::are_equal(expected, actual, message, line_info);
375  } catch(...) {
376  assert::abort();
377  }
378  }
380 
392  template<typename TExpected, typename TAcutal>
393  static void are_equivalent(const TExpected& expected, const TAcutal& actual) {are_equivalent(expected, actual, "", line_info());}
394 
406  template<typename TExpected, typename TAcutal>
407  static void are_equivalent(const TExpected& expected, const TAcutal& actual, const std::string& message) {are_equivalent(expected, actual, message, line_info());}
408 
420  template<typename TExpected, typename TAcutal>
421  static void are_equivalent(const TExpected& expected, const TAcutal& actual, const xtd::tunit::line_info& line_info) {are_equivalent(expected, actual, "", line_info);}
422 
434  template<typename TExpected, typename TAcutal>
435  static void are_equivalent(const TExpected& expected, const TAcutal& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
436  try {
437  collection_assert::are_equivalent(expected, actual, message, line_info);
438  } catch(...) {
439  assert::abort();
440  }
441  }
442 
444  template<typename TExpected, typename TActual>
445  static void are_equivalent(const std::initializer_list<TExpected>& expected, const std::initializer_list<TActual>& actual) {are_equivalent(expected, actual, "", line_info());}
446  template<typename TExpected, typename TActual>
447  static void are_equivalent(const std::initializer_list<TExpected>& expected, const std::initializer_list<TActual>& actual, const xtd::tunit::line_info& line_info) {are_equivalent(expected, actual, "", line_info);}
448  template<typename TExpected, typename TActual>
449  static void are_equivalent(const std::initializer_list<TExpected>& expected, const std::initializer_list<TActual>& actual, const std::string& message) {are_equal(are_equivalent, actual, message, line_info());}
450  template<typename TExpected, typename TActual>
451  static void are_equivalent(const std::initializer_list<TExpected>& expected, const std::initializer_list<TActual>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
452  try {
453  collection_assert::are_equivalent(expected, actual, message, line_info);
454  } catch(...) {
455  assert::abort();
456  }
457  }
458 
460  template<typename TCollection, typename TItem>
461  static void are_equivalent(const TCollection& expected, const std::initializer_list<TItem>& actual) {are_equivalent(expected, actual, "", line_info());}
462  template<typename TCollection, typename TItem>
463  static void are_equivalent(const TCollection& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {are_equivalent(expected, actual, "", line_info);}
464  template<typename TCollection, typename TItem>
465  static void are_equivalent(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message) {are_equivalent(expected, actual, message, line_info());}
466  template<typename TCollection, typename TItem>
467  static void are_equivalent(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
468  try {
469  collection_assert::are_equivalent(expected, actual, message, line_info);
470  } catch(...) {
471  assert::abort();
472  }
473  }
474 
476  template<typename TItem, typename TCollection>
477  static void are_equivalent(const std::initializer_list<TItem>& expected, const TCollection& actual) {are_equivalent(expected, actual, "", line_info());}
478  template<typename TItem, typename TCollection>
479  static void are_equivalent(const std::initializer_list<TItem>& expected, const TCollection& actual, const xtd::tunit::line_info& line_info) {are_equivalent(expected, actual, "", line_info);}
480  template<typename TItem, typename TCollection>
481  static void are_equivalent(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message) {are_equivalent(expected, actual, message, line_info());}
482  template<typename TItem, typename TCollection>
483  static void are_equivalent(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
484  try {
485  collection_assert::are_equivalent(expected, actual, message, line_info);
486  } catch(...) {
487  assert::abort();
488  }
489  }
491 
503  template<typename TExpected, typename TAcutal>
504  static void are_not_equal(const TExpected& expected, const TAcutal& actual) {are_not_equal(expected, actual, "", line_info());}
505 
517  template<typename TExpected, typename TAcutal>
518  static void are_not_equal(const TExpected& expected, const TAcutal& actual, const std::string& message) {are_not_equal(expected, actual, message, line_info());}
519 
531  template<typename TExpected, typename TAcutal>
532  static void are_not_equal(const TExpected& expected, const TAcutal& actual, const xtd::tunit::line_info& line_info) {are_not_equal(expected, actual, "", line_info);}
533 
545  template<typename TExpected, typename TAcutal>
546  static void are_not_equal(const TExpected& expected, const TAcutal& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
547  try {
548  collection_assert::are_not_equal(expected, actual, message, line_info);
549  } catch(...) {
550  assert::abort();
551  }
552  }
553 
555  template<typename TItem>
556  static void are_not_equal(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual) {are_not_equal(expected, actual, "", line_info());}
557  template<typename TItem>
558  static void are_not_equal(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {are_not_equal(expected, actual, "", line_info);}
559  template<typename TItem>
560  static void are_not_equal(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const std::string& message) {are_not_equal(expected, actual, message, line_info());}
561  template<typename TItem>
562  static void are_not_equal(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
563  try {
564  collection_assert::are_not_equal(expected, actual, message, line_info);
565  } catch(...) {
566  assert::abort();
567  }
568  }
569 
571  template<typename TCollection, typename TItem>
572  static void are_not_equal(const TCollection& expected, const std::initializer_list<TItem>& actual) {are_not_equal(expected, actual, "", line_info());}
573  template<typename TCollection, typename TItem>
574  static void are_not_equal(const TCollection& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {are_not_equal(expected, actual, "", line_info);}
575  template<typename TCollection, typename TItem>
576  static void are_not_equal(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message) {are_not_equal(expected, actual, message, line_info());}
577  template<typename TCollection, typename TItem>
578  static void are_not_equal(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
579  try {
580  collection_assert::are_not_equal(expected, actual, message, line_info);
581  } catch(...) {
582  assert::abort();
583  }
584  }
585 
587  template<typename TItem, typename TCollection>
588  static void are_not_equal(const std::initializer_list<TItem>& expected, const TCollection& actual) {are_not_equal(expected, actual, "", line_info());}
589  template<typename TItem, typename TCollection>
590  static void are_not_equal(const std::initializer_list<TItem>& expected, const TCollection& actual, const xtd::tunit::line_info& line_info) {are_not_equal(expected, actual, "", line_info);}
591  template<typename TItem, typename TCollection>
592  static void are_not_equal(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message) {are_not_equal(expected, actual, message, line_info());}
593  template<typename TItem, typename TCollection>
594  static void are_not_equal(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
595  try {
596  collection_assert::are_not_equal(expected, actual, message, line_info);
597  } catch(...) {
598  assert::abort();
599  }
600  }
602 
614  template<typename TExpected, typename TAcutal>
615  static void are_not_equivalent(const TExpected& expected, const TAcutal& actual) {are_not_equivalent(expected, actual, "", line_info());}
616 
628  template<typename TExpected, typename TAcutal>
629  static void are_not_equivalent(const TExpected& expected, const TAcutal& actual, const std::string& message) {are_not_equivalent(expected, actual, message, line_info());}
630 
642  template<typename TExpected, typename TAcutal>
643  static void are_not_equivalent(const TExpected& expected, const TAcutal& actual, const xtd::tunit::line_info& line_info) {are_not_equivalent(expected, actual, "", line_info);}
644 
656  template<typename TExpected, typename TAcutal>
657  static void are_not_equivalent(const TExpected& expected, const TAcutal& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
658  try {
659  collection_assert::are_not_equivalent(expected, actual, message, line_info);
660  } catch(...) {
661  assert::abort();
662  }
663  }
664 
666  template<typename TExpected, typename TActual>
667  static void are_not_equivalent(const std::initializer_list<TExpected>& expected, const std::initializer_list<TActual>& actual) {are_not_equivalent(expected, actual, "", line_info());}
668  template<typename TExpected, typename TActual>
669  static void are_not_equivalent(const std::initializer_list<TExpected>& expected, const std::initializer_list<TActual>& actual, const xtd::tunit::line_info& line_info) {are_not_equivalent(expected, actual, "", line_info);}
670  template<typename TExpected, typename TActual>
671  static void are_not_equivalent(const std::initializer_list<TExpected>& expected, const std::initializer_list<TActual>& actual, const std::string& message) {are_not_equivalent(are_equivalent, actual, message, line_info());}
672  template<typename TExpected, typename TActual>
673  static void are_not_equivalent(const std::initializer_list<TExpected>& expected, const std::initializer_list<TActual>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
674  try {
675  collection_assert::are_not_equivalent(expected, actual, message, line_info);
676  } catch(...) {
677  assert::abort();
678  }
679  }
680 
682  template<typename TCollection, typename TItem>
683  static void are_not_equivalent(const TCollection& expected, const std::initializer_list<TItem>& actual) {are_not_equivalent(expected, actual, "", line_info());}
684  template<typename TCollection, typename TItem>
685  static void are_not_equivalent(const TCollection& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {are_not_equivalent(expected, actual, "", line_info);}
686  template<typename TCollection, typename TItem>
687  static void are_not_equivalent(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message) {are_not_equivalent(expected, actual, message, line_info());}
688  template<typename TCollection, typename TItem>
689  static void are_not_equivalent(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
690  try {
691  collection_assert::are_not_equivalent(expected, actual, message, line_info);
692  } catch(...) {
693  assert::abort();
694  }
695  }
696 
698  template<typename TItem, typename TCollection>
699  static void are_not_equivalent(const std::initializer_list<TItem>& expected, const TCollection& actual) {are_not_equivalent(expected, actual, "", line_info());}
700  template<typename TItem, typename TCollection>
701  static void are_not_equivalent(const std::initializer_list<TItem>& expected, const TCollection& actual, const xtd::tunit::line_info& line_info) {are_not_equivalent(expected, actual, "", line_info);}
702  template<typename TItem, typename TCollection>
703  static void are_not_equivalent(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message) {are_not_equivalent(expected, actual, message, line_info());}
704  template<typename TItem, typename TCollection>
705  static void are_not_equivalent(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
706  try {
707  collection_assert::are_not_equivalent(expected, actual, message, line_info);
708  } catch(...) {
709  assert::abort();
710  }
711  }
713 
725  template<typename TExpected, typename TAcutal>
726  static void contains(const TExpected& expected, const TAcutal& actual) {contains(expected, actual, "", line_info());}
727 
739  template<typename TExpected, typename TAcutal>
740  static void contains(const TExpected& expected, const TAcutal& actual, const std::string& message) {contains(expected, actual, message, line_info());}
741 
753  template<typename TExpected, typename TAcutal>
754  static void contains(const TExpected& expected, const TAcutal& actual, const xtd::tunit::line_info& line_info) {contains(expected, actual, "", line_info);}
755 
767  template<typename TExpected, typename TAcutal>
768  static void contains(const TExpected& expected, const TAcutal& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
769  try {
770  collection_assert::contains(expected, actual, message, line_info);
771  } catch(...) {
772  assert::abort();
773  }
774  }
775 
777  template<typename TItem>
778  static void contains(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual) {contains(expected, actual, "", line_info());}
779  template<typename TItem>
780  static void contains(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {contains(expected, actual, "", line_info);}
781  template<typename TItem>
782  static void contains(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const std::string& message) {contains(expected, actual, message, line_info());}
783  template<typename TItem>
784  static void contains(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
785  try {
786  collection_assert::contains(expected, actual, message, line_info);
787  } catch(...) {
788  assert::abort();
789  }
790  }
791 
793  template<typename TCollection, typename TItem>
794  static void contains(const TCollection& expected, const std::initializer_list<TItem>& actual) {contains(expected, actual, "", line_info());}
795  template<typename TCollection, typename TItem>
796  static void contains(const TCollection& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {contains(expected, actual, "", line_info);}
797  template<typename TCollection, typename TItem>
798  static void contains(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message) {contains(expected, actual, message, line_info());}
799  template<typename TCollection, typename TItem>
800  static void contains(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
801  try {
802  collection_assert::contains(expected, actual, message, line_info);
803  } catch(...) {
804  assert::abort();
805  }
806  }
807 
809  template<typename TItem, typename TCollection>
810  static void contains(const std::initializer_list<TItem>& expected, const TCollection& actual) {contains(expected, actual, "", line_info());}
811  template<typename TItem, typename TCollection>
812  static void contains(const std::initializer_list<TItem>& expected, const TCollection& actual, const xtd::tunit::line_info& line_info) {contains(expected, actual, "", line_info);}
813  template<typename TItem, typename TCollection>
814  static void contains(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message) {contains(expected, actual, message, line_info());}
815  template<typename TItem, typename TCollection>
816  static void contains(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
817  try {
818  collection_assert::contains(expected, actual, message, line_info);
819  } catch(...) {
820  assert::abort();
821  }
822  }
824 
836  template<typename TExpected, typename TAcutal>
837  static void does_not_contain(const TExpected& expected, const TAcutal& actual) {does_not_contain(expected, actual, "", line_info());}
838 
850  template<typename TExpected, typename TAcutal>
851  static void does_not_contain(const TExpected& expected, const TAcutal& actual, const std::string& message) {does_not_contain(expected, actual, message, line_info());}
852 
864  template<typename TExpected, typename TAcutal>
865  static void does_not_contain(const TExpected& expected, const TAcutal& actual, const xtd::tunit::line_info& line_info) {does_not_contain(expected, actual, "", line_info);}
866 
878  template<typename TExpected, typename TAcutal>
879  static void does_not_contain(const TExpected& expected, const TAcutal& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
880  try {
881  collection_assert::does_not_contain(expected, actual, message, line_info);
882  } catch(...) {
883  assert::abort();
884  }
885  }
886 
888  template<typename TItem>
889  static void does_not_contain(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual) {does_not_contain(expected, actual, "", line_info());}
890  template<typename TItem>
891  static void does_not_contain(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {does_not_contain(expected, actual, "", line_info);}
892  template<typename TItem>
893  static void does_not_contain(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const std::string& message) {does_not_contain(expected, actual, message, line_info());}
894  template<typename TItem>
895  static void does_not_contain(const std::initializer_list<TItem>& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
896  try {
897  collection_assert::does_not_contain(expected, actual, message, line_info);
898  } catch(...) {
899  assert::abort();
900  }
901  }
902 
904  template<typename TCollection, typename TItem>
905  static void does_not_contain(const TCollection& expected, const std::initializer_list<TItem>& actual) {does_not_contain(expected, actual, "", line_info());}
906  template<typename TCollection, typename TItem>
907  static void does_not_contain(const TCollection& expected, const std::initializer_list<TItem>& actual, const xtd::tunit::line_info& line_info) {does_not_contain(expected, actual, "", line_info);}
908  template<typename TCollection, typename TItem>
909  static void does_not_contain(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message) {does_not_contain(expected, actual, message, line_info());}
910  template<typename TCollection, typename TItem>
911  static void does_not_contain(const TCollection& expected, const std::initializer_list<TItem>& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
912  try {
913  collection_assert::does_not_contain(expected, actual, message, line_info);
914  } catch(...) {
915  assert::abort();
916  }
917  }
918 
920  template<typename TItem, typename TCollection>
921  static void does_not_contain(const std::initializer_list<TItem>& expected, const TCollection& actual) {does_not_contain(expected, actual, "", line_info());}
922  template<typename TItem, typename TCollection>
923  static void does_not_contain(const std::initializer_list<TItem>& expected, const TCollection& actual, const xtd::tunit::line_info& line_info) {does_not_contain(expected, actual, "", line_info);}
924  template<typename TItem, typename TCollection>
925  static void does_not_contain(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message) {does_not_contain(expected, actual, message, line_info());}
926  template<typename TItem, typename TCollection>
927  static void does_not_contain(const std::initializer_list<TItem>& expected, const TCollection& actual, const std::string& message, const xtd::tunit::line_info& line_info) {
928  try {
929  collection_assert::does_not_contain(expected, actual, message, line_info);
930  } catch(...) {
931  assert::abort();
932  }
933  }
935 
946  template<typename TValue>
947  static void is_empty(const TValue& value) {is_empty(value, "", line_info());}
948 
960  template<typename TValue>
961  static void is_empty(const TValue& value, const xtd::tunit::line_info& line_info) {is_empty(value, "", line_info);}
962 
974  template<typename TValue>
975  static void is_empty(const TValue& value, const std::string& message) {is_empty(value, message, line_info());}
976 
989  template<typename TValue>
990  static void is_empty(const TValue& value, const std::string& message, const xtd::tunit::line_info& line_info) {
991  try {
992  collection_assert::is_empty(value, message, line_info);
993  } catch(...) {
994  assert::abort();
995  }
996  }
997 
999  template<typename TValue>
1000  static void is_empty(const std::initializer_list<TValue>& value) {is_empty(value, "", line_info());}
1001  template<typename TValue>
1002  static void is_empty(const std::initializer_list<TValue>& value, const xtd::tunit::line_info& line_info) {is_empty(value, "", line_info);}
1003  template<typename TValue>
1004  static void is_empty(const std::initializer_list<TValue>& value, const std::string& message) {is_empty(value, message, line_info());}
1005  template<typename TValue>
1006  static void is_empty(const std::initializer_list<TValue>& value, const std::string& message, const xtd::tunit::line_info& line_info) {
1007  try {
1008  collection_assert::is_empty(value, message, line_info);
1009  } catch(...) {
1010  assert::abort();
1011  }
1012  }
1014 
1025  template<typename TValue>
1026  static void is_not_empty(const TValue& value) {is_not_empty(value, "", line_info());}
1027 
1039  template<typename TValue>
1040  static void is_not_empty(const TValue& value, const xtd::tunit::line_info& line_info) {is_not_empty(value, "", line_info);}
1041 
1053  template<typename TValue>
1054  static void is_not_empty(const TValue& value, const std::string& message) {is_not_empty(value, message, line_info());}
1055 
1068  template<typename TValue>
1069  static void is_not_empty(const TValue& value, const std::string& message, const xtd::tunit::line_info& line_info) {
1070  try {
1071  collection_assert::is_not_empty(value, message, line_info);
1072  } catch(...) {
1073  assert::abort();
1074  }
1075  }
1076 
1078  template<typename TValue>
1079  static void is_not_empty(const std::initializer_list<TValue>& value) {is_not_empty(value, "", line_info());}
1080  template<typename TValue>
1081  static void is_not_empty(const std::initializer_list<TValue>& value, const xtd::tunit::line_info& line_info) {is_not_empty(value, "", line_info);}
1082  template<typename TValue>
1083  static void is_not_empty(const std::initializer_list<TValue>& value, const std::string& message) {is_not_empty(value, message, line_info());}
1084  template<typename TValue>
1085  static void is_not_empty(const std::initializer_list<TValue>& value, const std::string& message, const xtd::tunit::line_info& line_info) {
1086  try {
1087  collection_assert::is_not_empty(value, message, line_info);
1088  } catch(...) {
1089  assert::abort();
1090  }
1091  }
1093 
1104  template<typename TValue>
1105  static void is_ordered(const TValue& value) {is_ordered(value, "", line_info());}
1106 
1118  template<typename TValue>
1119  static void is_ordered(const TValue& value, const xtd::tunit::line_info& line_info) {is_ordered(value, "", line_info);}
1120 
1132  template<typename TValue>
1133  static void is_ordered(const TValue& value, const std::string& message) {is_ordered(value, message, line_info());}
1134 
1147  template<typename TValue>
1148  static void is_ordered(const TValue& value, const std::string& message, const xtd::tunit::line_info& line_info) {
1149  try {
1150  collection_assert::is_ordered(value, message, line_info);
1151  } catch(...) {
1152  assert::abort();
1153  }
1154  }
1155 
1157  template<typename TValue>
1158  static void is_ordered(const std::initializer_list<TValue>& value) {is_ordered(value, "", line_info());}
1159  template<typename TValue>
1160  static void is_ordered(const std::initializer_list<TValue>& value, const xtd::tunit::line_info& line_info) {is_ordered(value, "", line_info);}
1161  template<typename TValue>
1162  static void is_ordered(const std::initializer_list<TValue>& value, const std::string& message) {is_ordered(value, message, line_info());}
1163  template<typename TValue>
1164  static void is_ordered(const std::initializer_list<TValue>& value, const std::string& message, const xtd::tunit::line_info& line_info) {
1165  try {
1166  collection_assert::is_ordered(value, message, line_info);
1167  } catch(...) {
1168  assert::abort();
1169  }
1170  }
1172  };
1173  }
1174 }
Definition: base_assert.h:18
static void are_equivalent(const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
Assumes that all collection items are equivalent.
Definition: collection_assume.h:421
static void all_items_are_not_null(const TCollection &collection, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that all collection items are not null.
Definition: collection_assume.h:162
Contains xtd::tunit::collection_assert class.
static void all_items_are_unique(const TCollection &collection, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that all collection items are unique.
Definition: collection_assume.h:245
static void is_empty(const TValue &value, const xtd::tunit::line_info &line_info)
Assumes that collection contains an item.
Definition: collection_assume.h:961
static void all_items_are_unique(const TCollection &collection)
Asserts that all collection items are unique.
Definition: collection_assert.h:203
static void is_empty(const TValue &value)
Assumes that collection contains an item.
Definition: collection_assume.h:947
static void all_items_are_unique(const TCollection &collection, const xtd::tunit::line_info &line_info)
Assumes that all collection items are unique.
Definition: collection_assume.h:230
static void are_not_equal(const TExpected &expected, const TAcutal &actual, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that all collection items arenot equal.
Definition: collection_assume.h:546
static void are_equal(const TExpected &expected, const TAcutal &actual)
Asserts that all collection items are equal.
Definition: collection_assert.h:290
line_info information class is used to store current file, current line and current function informat...
Definition: line_info.h:15
static void all_items_are_instances_of(const TCollection &collection, const xtd::tunit::line_info &line_info)
Assumes that all collection items are of the type supplied or a derived type.
Definition: collection_assume.h:61
static void abort()
Abort current test. This is used by the other Assert functions.
Definition: base_assert.h:29
static void does_not_contain(const TExpected &expected, const TAcutal &actual, const std::string &message)
Assumes that collection contains all items.
Definition: collection_assume.h:851
static void does_not_contain(const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
Assumes that collection contains all items.
Definition: collection_assume.h:865
static void are_not_equal(const TExpected &expected, const TAcutal &actual, const std::string &message)
Assumes that all collection items are not equal.
Definition: collection_assume.h:518
static void are_equivalent(const TExpected &expected, const TAcutal &actual, const std::string &message)
Assumes that all collection items are equivalent.
Definition: collection_assume.h:407
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:15
static void are_not_equivalent(const TExpected &expected, const TAcutal &actual)
Asserts that all collection items are not equivalent.
Definition: collection_assert.h:627
static void all_items_are_not_null(const TCollection &collection)
Asserts that all collection items are not null.
Definition: collection_assert.h:115
static void are_not_equal(const TExpected &expected, const TAcutal &actual)
Asserts that all collection items are not equal.
Definition: collection_assert.h:520
static void are_equivalent(const TExpected &expected, const TAcutal &actual)
Assumes that all collection items are equivalent.
Definition: collection_assume.h:393
static void are_equal(const TExpected &expected, const TAcutal &actual)
Assumes that all collection items are equal.
Definition: collection_assume.h:282
static void all_items_are_not_null(const TCollection &collection, const xtd::tunit::line_info &line_info)
Assumes that all collection items are not null.
Definition: collection_assume.h:146
static void does_not_contain(const TExpected &expected, const TAcutal &actual)
Assumes that ollection contains all items.
Definition: collection_assume.h:837
static void is_not_empty(const TValue &value)
Assumes that collection does not contain any item.
Definition: collection_assume.h:1026
static void are_equivalent(const TExpected &expected, const TAcutal &actual, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that all collection items are equivalent.
Definition: collection_assume.h:435
static void is_ordered(const TValue &value, const xtd::tunit::line_info &line_info)
Assumes that collection is ordered.
Definition: collection_assume.h:1119
static void contains(const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
Assumes that collection contains all items.
Definition: collection_assume.h:754
static void contains(const TExpected &expected, const TAcutal &actual, const std::string &message)
Assumes that collection contains all items.
Definition: collection_assume.h:740
static void is_not_empty(const TValue &value, const xtd::tunit::line_info &line_info)
Assumes that collection or traits does not contain any item.
Definition: collection_assume.h:1040
The collection_assume class contains a collection of static methods that implement the most collectio...
Definition: collection_assume.h:15
static void contains(const TExpected &expected, const TAcutal &actual)
Asserts that ollection contains all items.
Definition: collection_assert.h:750
static void does_not_contain(const TExpected &expected, const TAcutal &actual)
Asserts that ollection contains all items.
Definition: collection_assert.h:869
Contains xtd::tunit::assume class.
static void are_not_equivalent(const TExpected &expected, const TAcutal &actual, const std::string &message)
Assumes that all collection items are not equivalent.
Definition: collection_assume.h:629
static void is_ordered(const TValue &value)
Assumes that collection is ordered.
Definition: collection_assume.h:1105
static void are_not_equivalent(const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
Assumes that all collection items are not equivalent.
Definition: collection_assume.h:643
static void all_items_are_instances_of(const TCollection &collection, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that all collection items are of the type supplied or a derived type.
Definition: collection_assume.h:75
static void is_ordered(const TValue &value, const std::string &message)
Assumes that collection is ordered.
Definition: collection_assume.h:1133
static void all_items_are_unique(const TCollection &collection)
Assumes that all collection items are unique.
Definition: collection_assume.h:200
static void does_not_contain(const TExpected &expected, const TAcutal &actual, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that collection contains all items.
Definition: collection_assume.h:879
static void all_items_are_unique(const TCollection &collection, const std::string &message)
Assumes that all collection items are unique.
Definition: collection_assume.h:215
static void contains(const TExpected &expected, const TAcutal &actual)
Assumes that ollection contains all items.
Definition: collection_assume.h:726
static void are_not_equal(const TExpected &expected, const TAcutal &actual)
Assumes that all collection items are not equal.
Definition: collection_assume.h:504
static void are_not_equivalent(const TExpected &expected, const TAcutal &actual)
Assumes that all collection items are not equivalent.
Definition: collection_assume.h:615
static void is_ordered(const TValue &value)
Asserts that collection is ordered.
Definition: collection_assert.h:1141
static void are_not_equal(const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
Assumes that all collection items are not equal.
Definition: collection_assume.h:532
static void are_equal(const TExpected &expected, const TAcutal &actual, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that all collection items are equal.
Definition: collection_assume.h:324
static void are_equal(const TExpected &expected, const TAcutal &actual, const xtd::tunit::line_info &line_info)
Assumes that all collection items are equal.
Definition: collection_assume.h:310
static void is_ordered(const TValue &value, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that collection is ordered.
Definition: collection_assume.h:1148
static void are_equal(const TExpected &expected, const TAcutal &actual, const std::string &message)
Assumes that all collection items are equal.
Definition: collection_assume.h:296
static void is_empty(const TValue &value, const std::string &message)
Assumes that collection contains an item.
Definition: collection_assume.h:975
static void all_items_are_instances_of(const TCollection &collection)
Assumes that all collection items are of the type supplied or a derived type.
Definition: collection_assume.h:33
static void is_empty(const TValue &value, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that collection contains an item.
Definition: collection_assume.h:990
static void are_not_equivalent(const TExpected &expected, const TAcutal &actual, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that all collection items are not equivalent.
Definition: collection_assume.h:657
static void is_not_empty(const TValue &value)
Asserts that collection does not contain any item.
Definition: collection_assert.h:1064
static void contains(const TExpected &expected, const TAcutal &actual, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that collection contains all items.
Definition: collection_assume.h:768
static void is_empty(const TValue &value)
Asserts that collection contains an item.
Definition: collection_assert.h:987
static void all_items_are_instances_of(const TCollection &collection, const std::string &message)
Assumes that all collection items are of the type supplied or a derived type.
Definition: collection_assume.h:47
static void is_not_empty(const TValue &value, const std::string &message)
Assumes that collection or traits does not contain any item.
Definition: collection_assume.h:1054
static void are_equivalent(const TExpected &expected, const TAcutal &actual)
Asserts that all collection items are equivalent.
Definition: collection_assert.h:397
static void is_not_empty(const TValue &value, const std::string &message, const xtd::tunit::line_info &line_info)
Assumes that collection or traits does not contain any item.
Definition: collection_assume.h:1069
static void all_items_are_not_null(const TCollection &collection, const std::string &message)
Assumes that all collection items are not null.
Definition: collection_assume.h:130
static void all_items_are_not_null(const TCollection &collection)
Assumes that all collection items are not null.
Definition: collection_assume.h:114