xtd - Reference Guide 0.2.0
collection_valid.h
Go to the documentation of this file.
1 #pragma once
5 #include "valid.h"
6 #include "collection_valid.h"
7 
9 namespace xtd {
11  namespace tunit {
23  class collection_valid final : private base_assert {
24  public:
26  collection_valid() = delete;
28 
39  template<typename expected_t, typename collection_t>
40  static void all_items_are_instances_of(const collection_t& collection) {all_items_are_instances_of<expected_t>(collection, "", xtd::diagnostics::stack_frame::empty());}
41 
52  template<typename expected_t, typename collection_t>
53  static void all_items_are_instances_of(const collection_t& collection, const std::string& message) {all_items_are_instances_of<expected_t>(collection, message, xtd::diagnostics::stack_frame::empty());}
54 
65  template<typename expected_t, typename collection_t>
66  static void all_items_are_instances_of(const collection_t& collection, const xtd::diagnostics::stack_frame& stack_frame) {all_items_are_instances_of<expected_t>(collection, "", stack_frame);}
67 
78  template<typename expected_t, typename collection_t>
79  static void all_items_are_instances_of(const collection_t& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
80  try {
81  collection_assert::all_items_are_instances_of<expected_t>(collection, message, stack_frame);
82  } catch (...) {
83  base_assert::error();
84  }
85  }
86 
88  template<typename expected_t, typename item_t>
89  static void all_items_are_instances_of(const std::initializer_list<item_t>& collection) {all_items_are_instances_of<expected_t>(collection, "", xtd::diagnostics::stack_frame::empty());}
90  template<typename expected_t, typename item_t>
91  static void all_items_are_instances_of(const std::initializer_list<item_t>& collection, const std::string& message) {all_items_are_instances_of<expected_t>(collection, message, xtd::diagnostics::stack_frame::empty());}
92  template<typename expected_t, typename item_t>
93  static void all_items_are_instances_of(const std::initializer_list<item_t>& collection, const xtd::diagnostics::stack_frame& stack_frame) {all_items_are_instances_of<expected_t>(collection, "", stack_frame);}
94  template<typename expected_t, typename item_t>
95  static void all_items_are_instances_of(const std::initializer_list<item_t>& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
96  try {
97  collection_assert::all_items_are_instances_of<expected_t>(collection, message, stack_frame);
98  } catch (...) {
99  base_assert::error();
100  }
101  }
103 
116  template<typename collection_t>
117  static void all_items_are_not_null(const collection_t& collection) {all_items_are_not_null(collection, "", xtd::diagnostics::stack_frame::empty());}
118 
131  template<typename collection_t>
132  static void all_items_are_not_null(const collection_t& collection, const std::string& message) {all_items_are_not_null(collection, message, xtd::diagnostics::stack_frame::empty());}
133 
146  template<typename collection_t>
147  static void all_items_are_not_null(const collection_t& collection, const xtd::diagnostics::stack_frame& stack_frame) {all_items_are_instances_of(collection, "", stack_frame);}
148 
161  template<typename collection_t>
162  static void all_items_are_not_null(const collection_t& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
163  try {
164  collection_assert::all_items_are_not_null(collection, message, stack_frame);
165  } catch (...) {
166  base_assert::error();
167  }
168  }
169 
171  template<typename item_t>
172  static void all_items_are_not_null(const std::initializer_list<item_t>& collection) {all_items_are_not_null(collection, "", xtd::diagnostics::stack_frame::empty());}
173  template<typename item_t>
174  static void all_items_are_not_null(const std::initializer_list<item_t>& collection, const std::string& message) {all_items_are_not_null(collection, message, xtd::diagnostics::stack_frame::empty());}
175  template<typename item_t>
176  static void all_items_are_not_null(const std::initializer_list<item_t>& collection, const xtd::diagnostics::stack_frame& stack_frame) {all_items_are_instances_of(collection, "", stack_frame);}
177  template<typename item_t>
178  static void all_items_are_not_null(const std::initializer_list<item_t>& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
179  try {
180  collection_assert::all_items_are_not_null(collection, message, stack_frame);
181  } catch (...) {
182  base_assert::error();
183  }
184  }
186 
198  template<typename collection_t>
199  static void all_items_are_unique(const collection_t& collection) {all_items_are_unique(collection, "", xtd::diagnostics::stack_frame::empty());}
200 
212  template<typename collection_t>
213  static void all_items_are_unique(const collection_t& collection, const std::string& message) {all_items_are_unique(collection, message, xtd::diagnostics::stack_frame::empty());}
214 
226  template<typename collection_t>
227  static void all_items_are_unique(const collection_t& collection, const xtd::diagnostics::stack_frame& stack_frame) {all_items_are_unique(collection, "", stack_frame);}
228 
240  template<typename collection_t>
241  static void all_items_are_unique(const collection_t& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
242  try {
243  collection_assert::all_items_are_unique(collection, message, stack_frame);
244  } catch (...) {
245  base_assert::error();
246  }
247  }
248 
250  template<typename item_t>
251  static void all_items_are_unique(const std::initializer_list<item_t>& collection) {all_items_are_unique(collection, "", xtd::diagnostics::stack_frame::empty());}
252  template<typename item_t>
253  static void all_items_are_unique(const std::initializer_list<item_t>& collection, const xtd::diagnostics::stack_frame& stack_frame) {all_items_are_unique(collection, "", stack_frame);}
254  template<typename item_t>
255  static void all_items_are_unique(const std::initializer_list<item_t>& collection, const std::string& message) {all_items_are_unique(collection, message, xtd::diagnostics::stack_frame::empty());}
256  template<typename item_t>
257  static void all_items_are_unique(const std::initializer_list<item_t>& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
258  try {
259  collection_assert::all_items_are_unique(collection, message, stack_frame);
260  } catch (...) {
261  base_assert::error();
262  }
263  }
265 
276  template<typename expected_t, typename actual_t>
277  static void are_equal(const expected_t& expected, const actual_t& actual) {are_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
278 
289  template<typename expected_t, typename actual_t>
290  static void are_equal(const expected_t& expected, const actual_t& actual, const std::string& message) {are_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
291 
302  template<typename expected_t, typename actual_t>
303  static void are_equal(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equal(expected, actual, "", stack_frame);}
304 
315  template<typename expected_t, typename actual_t>
316  static void are_equal(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
317  try {
318  collection_assert::are_equal(expected, actual, message, stack_frame);
319  } catch (...) {
320  base_assert::error();
321  }
322  }
323 
325  template<typename item_t>
326  static void are_equal(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual) {are_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
327  template<typename item_t>
328  static void are_equal(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equal(expected, actual, "", stack_frame);}
329  template<typename item_t>
330  static void are_equal(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const std::string& message) {are_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
331  template<typename item_t>
332  static void are_equal(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
333  try {
334  collection_assert::are_equal(expected, actual, message, stack_frame);
335  } catch (...) {
336  base_assert::error();
337  }
338  }
339 
341  template<typename collection_t, typename item_t>
342  static void are_equal(const collection_t& expected, const std::initializer_list<item_t>& actual) {are_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
343  template<typename collection_t, typename item_t>
344  static void are_equal(const collection_t& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equal(expected, actual, "", stack_frame);}
345  template<typename collection_t, typename item_t>
346  static void are_equal(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message) {are_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
347  template<typename collection_t, typename item_t>
348  static void are_equal(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
349  try {
350  collection_assert::are_equal(expected, actual, message, stack_frame);
351  } catch (...) {
352  base_assert::error();
353  }
354  }
355 
357  template<typename item_t, typename collection_t>
358  static void are_equal(const std::initializer_list<item_t>& expected, const collection_t& actual) {are_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
359  template<typename item_t, typename collection_t>
360  static void are_equal(const std::initializer_list<item_t>& expected, const collection_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equal(expected, actual, "", stack_frame);}
361  template<typename item_t, typename collection_t>
362  static void are_equal(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message) {are_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
363  template<typename item_t, typename collection_t>
364  static void are_equal(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
365  try {
366  collection_assert::are_equal(expected, actual, message, stack_frame);
367  } catch (...) {
368  base_assert::error();
369  }
370  }
372 
383  template<typename expected_t, typename actual_t>
384  static void are_equivalent(const expected_t& expected, const actual_t& actual) {are_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
385 
396  template<typename expected_t, typename actual_t>
397  static void are_equivalent(const expected_t& expected, const actual_t& actual, const std::string& message) {are_equivalent(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
398 
409  template<typename expected_t, typename actual_t>
410  static void are_equivalent(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equivalent(expected, actual, "", stack_frame);}
411 
422  template<typename expected_t, typename actual_t>
423  static void are_equivalent(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
424  try {
425  collection_assert::are_equivalent(expected, actual, message, stack_frame);
426  } catch (...) {
427  base_assert::error();
428  }
429  }
430 
432  template<typename expected_t, typename actual_t>
433  static void are_equivalent(const std::initializer_list<expected_t>& expected, const std::initializer_list<actual_t>& actual) {are_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
434  template<typename expected_t, typename actual_t>
435  static void are_equivalent(const std::initializer_list<expected_t>& expected, const std::initializer_list<actual_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equivalent(expected, actual, "", stack_frame);}
436  template<typename expected_t, typename actual_t>
437  static void are_equivalent(const std::initializer_list<expected_t>& expected, const std::initializer_list<actual_t>& actual, const std::string& message) {are_equal(are_equivalent, actual, message, xtd::diagnostics::stack_frame::empty());}
438  template<typename expected_t, typename actual_t>
439  static void are_equivalent(const std::initializer_list<expected_t>& expected, const std::initializer_list<actual_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
440  try {
441  collection_assert::are_equivalent(expected, actual, message, stack_frame);
442  } catch (...) {
443  base_assert::error();
444  }
445  }
446 
448  template<typename collection_t, typename item_t>
449  static void are_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual) {are_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
450  template<typename collection_t, typename item_t>
451  static void are_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equivalent(expected, actual, "", stack_frame);}
452  template<typename collection_t, typename item_t>
453  static void are_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message) {are_equivalent(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
454  template<typename collection_t, typename item_t>
455  static void are_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
456  try {
457  collection_assert::are_equivalent(expected, actual, message, stack_frame);
458  } catch (...) {
459  base_assert::error();
460  }
461  }
462 
464  template<typename item_t, typename collection_t>
465  static void are_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual) {are_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
466  template<typename item_t, typename collection_t>
467  static void are_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_equivalent(expected, actual, "", stack_frame);}
468  template<typename item_t, typename collection_t>
469  static void are_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message) {are_equivalent(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
470  template<typename item_t, typename collection_t>
471  static void are_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
472  try {
473  collection_assert::are_equivalent(expected, actual, message, stack_frame);
474  } catch (...) {
475  base_assert::error();
476  }
477  }
479 
490  template<typename expected_t, typename actual_t>
491  static void are_not_equal(const expected_t& expected, const actual_t& actual) {are_not_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
492 
503  template<typename expected_t, typename actual_t>
504  static void are_not_equal(const expected_t& expected, const actual_t& actual, const std::string& message) {are_not_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
505 
516  template<typename expected_t, typename actual_t>
517  static void are_not_equal(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equal(expected, actual, "", stack_frame);}
518 
529  template<typename expected_t, typename actual_t>
530  static void are_not_equal(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
531  try {
532  collection_assert::are_not_equal(expected, actual, message, stack_frame);
533  } catch (...) {
534  base_assert::error();
535  }
536  }
537 
539  template<typename item_t>
540  static void are_not_equal(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual) {are_not_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
541  template<typename item_t>
542  static void are_not_equal(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equal(expected, actual, "", stack_frame);}
543  template<typename item_t>
544  static void are_not_equal(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const std::string& message) {are_not_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
545  template<typename item_t>
546  static void are_not_equal(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
547  try {
548  collection_assert::are_not_equal(expected, actual, message, stack_frame);
549  } catch (...) {
550  base_assert::error();
551  }
552  }
553 
555  template<typename collection_t, typename item_t>
556  static void are_not_equal(const collection_t& expected, const std::initializer_list<item_t>& actual) {are_not_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
557  template<typename collection_t, typename item_t>
558  static void are_not_equal(const collection_t& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equal(expected, actual, "", stack_frame);}
559  template<typename collection_t, typename item_t>
560  static void are_not_equal(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message) {are_not_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
561  template<typename collection_t, typename item_t>
562  static void are_not_equal(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
563  try {
564  collection_assert::are_not_equal(expected, actual, message, stack_frame);
565  } catch (...) {
566  base_assert::error();
567  }
568  }
569 
571  template<typename item_t, typename collection_t>
572  static void are_not_equal(const std::initializer_list<item_t>& expected, const collection_t& actual) {are_not_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
573  template<typename item_t, typename collection_t>
574  static void are_not_equal(const std::initializer_list<item_t>& expected, const collection_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equal(expected, actual, "", stack_frame);}
575  template<typename item_t, typename collection_t>
576  static void are_not_equal(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message) {are_not_equal(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
577  template<typename item_t, typename collection_t>
578  static void are_not_equal(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
579  try {
580  collection_assert::are_not_equal(expected, actual, message, stack_frame);
581  } catch (...) {
582  base_assert::error();
583  }
584  }
586 
597  template<typename expected_t, typename actual_t>
598  static void are_not_equivalent(const expected_t& expected, const actual_t& actual) {are_not_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
599 
610  template<typename expected_t, typename actual_t>
611  static void are_not_equivalent(const expected_t& expected, const actual_t& actual, const std::string& message) {are_not_equivalent(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
612 
623  template<typename expected_t, typename actual_t>
624  static void are_not_equivalent(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equivalent(expected, actual, "", stack_frame);}
625 
636  template<typename expected_t, typename actual_t>
637  static void are_not_equivalent(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
638  try {
639  collection_assert::are_not_equivalent(expected, actual, message, stack_frame);
640  } catch (...) {
641  base_assert::error();
642  }
643  }
644 
646  template<typename expected_t, typename actual_t>
647  static void are_not_equivalent(const std::initializer_list<expected_t>& expected, const std::initializer_list<actual_t>& actual) {are_not_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
648  template<typename expected_t, typename actual_t>
649  static void are_not_equivalent(const std::initializer_list<expected_t>& expected, const std::initializer_list<actual_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equivalent(expected, actual, "", stack_frame);}
650  template<typename expected_t, typename actual_t>
651  static void are_not_equivalent(const std::initializer_list<expected_t>& expected, const std::initializer_list<actual_t>& actual, const std::string& message) {are_not_equivalent(are_equivalent, actual, message, xtd::diagnostics::stack_frame::empty());}
652  template<typename expected_t, typename actual_t>
653  static void are_not_equivalent(const std::initializer_list<expected_t>& expected, const std::initializer_list<actual_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
654  try {
655  collection_assert::are_not_equivalent(expected, actual, message, stack_frame);
656  } catch (...) {
657  base_assert::error();
658  }
659  }
660 
662  template<typename collection_t, typename item_t>
663  static void are_not_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual) {are_not_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
664  template<typename collection_t, typename item_t>
665  static void are_not_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equivalent(expected, actual, "", stack_frame);}
666  template<typename collection_t, typename item_t>
667  static void are_not_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message) {are_not_equivalent(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
668  template<typename collection_t, typename item_t>
669  static void are_not_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
670  try {
671  collection_assert::are_not_equivalent(expected, actual, message, stack_frame);
672  } catch (...) {
673  base_assert::error();
674  }
675  }
676 
678  template<typename item_t, typename collection_t>
679  static void are_not_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual) {are_not_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
680  template<typename item_t, typename collection_t>
681  static void are_not_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {are_not_equivalent(expected, actual, "", stack_frame);}
682  template<typename item_t, typename collection_t>
683  static void are_not_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message) {are_not_equivalent(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
684  template<typename item_t, typename collection_t>
685  static void are_not_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
686  try {
687  collection_assert::are_not_equivalent(expected, actual, message, stack_frame);
688  } catch (...) {
689  base_assert::error();
690  }
691  }
693 
704  template<typename expected_t, typename actual_t>
705  static void contains(const expected_t& expected, const actual_t& actual) {contains(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
706 
717  template<typename expected_t, typename actual_t>
718  static void contains(const expected_t& expected, const actual_t& actual, const std::string& message) {contains(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
719 
730  template<typename expected_t, typename actual_t>
731  static void contains(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {contains(expected, actual, "", stack_frame);}
732 
743  template<typename expected_t, typename actual_t>
744  static void contains(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
745  try {
746  collection_assert::contains(expected, actual, message, stack_frame);
747  } catch (...) {
748  base_assert::error();
749  }
750  }
751 
753  template<typename item_t>
754  static void contains(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual) {contains(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
755  template<typename item_t>
756  static void contains(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {contains(expected, actual, "", stack_frame);}
757  template<typename item_t>
758  static void contains(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const std::string& message) {contains(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
759  template<typename item_t>
760  static void contains(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
761  try {
762  collection_assert::contains(expected, actual, message, stack_frame);
763  } catch (...) {
764  base_assert::error();
765  }
766  }
767 
769  template<typename collection_t, typename item_t>
770  static void contains(const collection_t& expected, const std::initializer_list<item_t>& actual) {contains(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
771  template<typename collection_t, typename item_t>
772  static void contains(const collection_t& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {contains(expected, actual, "", stack_frame);}
773  template<typename collection_t, typename item_t>
774  static void contains(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message) {contains(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
775  template<typename collection_t, typename item_t>
776  static void contains(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
777  try {
778  collection_assert::contains(expected, actual, message, stack_frame);
779  } catch (...) {
780  base_assert::error();
781  }
782  }
783 
785  template<typename item_t, typename collection_t>
786  static void contains(const std::initializer_list<item_t>& expected, const collection_t& actual) {contains(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
787  template<typename item_t, typename collection_t>
788  static void contains(const std::initializer_list<item_t>& expected, const collection_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {contains(expected, actual, "", stack_frame);}
789  template<typename item_t, typename collection_t>
790  static void contains(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message) {contains(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
791  template<typename item_t, typename collection_t>
792  static void contains(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
793  try {
794  collection_assert::contains(expected, actual, message, stack_frame);
795  } catch (...) {
796  base_assert::error();
797  }
798  }
800 
811  template<typename expected_t, typename actual_t>
812  static void does_not_contain(const expected_t& expected, const actual_t& actual) {does_not_contain(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
813 
824  template<typename expected_t, typename actual_t>
825  static void does_not_contain(const expected_t& expected, const actual_t& actual, const std::string& message) {does_not_contain(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
826 
837  template<typename expected_t, typename actual_t>
838  static void does_not_contain(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {does_not_contain(expected, actual, "", stack_frame);}
839 
850  template<typename expected_t, typename actual_t>
851  static void does_not_contain(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
852  try {
853  collection_assert::does_not_contain(expected, actual, message, stack_frame);
854  } catch (...) {
855  base_assert::error();
856  }
857  }
858 
860  template<typename item_t>
861  static void does_not_contain(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual) {does_not_contain(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
862  template<typename item_t>
863  static void does_not_contain(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {does_not_contain(expected, actual, "", stack_frame);}
864  template<typename item_t>
865  static void does_not_contain(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const std::string& message) {does_not_contain(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
866  template<typename item_t>
867  static void does_not_contain(const std::initializer_list<item_t>& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
868  try {
869  collection_assert::does_not_contain(expected, actual, message, stack_frame);
870  } catch (...) {
871  base_assert::error();
872  }
873  }
874 
876  template<typename collection_t, typename item_t>
877  static void does_not_contain(const collection_t& expected, const std::initializer_list<item_t>& actual) {does_not_contain(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
878  template<typename collection_t, typename item_t>
879  static void does_not_contain(const collection_t& expected, const std::initializer_list<item_t>& actual, const xtd::diagnostics::stack_frame& stack_frame) {does_not_contain(expected, actual, "", stack_frame);}
880  template<typename collection_t, typename item_t>
881  static void does_not_contain(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message) {does_not_contain(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
882  template<typename collection_t, typename item_t>
883  static void does_not_contain(const collection_t& expected, const std::initializer_list<item_t>& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
884  try {
885  collection_assert::does_not_contain(expected, actual, message, stack_frame);
886  } catch (...) {
887  base_assert::error();
888  }
889  }
890 
892  template<typename item_t, typename collection_t>
893  static void does_not_contain(const std::initializer_list<item_t>& expected, const collection_t& actual) {does_not_contain(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
894  template<typename item_t, typename collection_t>
895  static void does_not_contain(const std::initializer_list<item_t>& expected, const collection_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {does_not_contain(expected, actual, "", stack_frame);}
896  template<typename item_t, typename collection_t>
897  static void does_not_contain(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message) {does_not_contain(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
898  template<typename item_t, typename collection_t>
899  static void does_not_contain(const std::initializer_list<item_t>& expected, const collection_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
900  try {
901  collection_assert::does_not_contain(expected, actual, message, stack_frame);
902  } catch (...) {
903  base_assert::error();
904  }
905  }
907 
917  template<typename value_t>
918  static void is_empty(const value_t& value) {is_empty(value, "", xtd::diagnostics::stack_frame::empty());}
919 
930  template<typename value_t>
931  static void is_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_empty(value, "", stack_frame);}
932 
943  template<typename value_t>
944  static void is_empty(const value_t& value, const std::string& message) {is_empty(value, message, xtd::diagnostics::stack_frame::empty());}
945 
957  template<typename value_t>
958  static void is_empty(const value_t& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
959  try {
960  collection_assert::is_empty(value, message, stack_frame);
961  } catch (...) {
962  base_assert::error();
963  }
964  }
965 
967  template<typename value_t>
968  static void is_empty(const std::initializer_list<value_t>& value) {is_empty(value, "", xtd::diagnostics::stack_frame::empty());}
969  template<typename value_t>
970  static void is_empty(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame) {is_empty(value, "", stack_frame);}
971  template<typename value_t>
972  static void is_empty(const std::initializer_list<value_t>& value, const std::string& message) {is_empty(value, message, xtd::diagnostics::stack_frame::empty());}
973  template<typename value_t>
974  static void is_empty(const std::initializer_list<value_t>& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
975  try {
976  collection_assert::is_empty(value, message, stack_frame);
977  } catch (...) {
978  base_assert::error();
979  }
980  }
982 
992  template<typename value_t>
993  static void is_not_empty(const value_t& value) {is_not_empty(value, "", xtd::diagnostics::stack_frame::empty());}
994 
1005  template<typename value_t>
1006  static void is_not_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_empty(value, "", stack_frame);}
1007 
1018  template<typename value_t>
1019  static void is_not_empty(const value_t& value, const std::string& message) {is_not_empty(value, message, xtd::diagnostics::stack_frame::empty());}
1020 
1032  template<typename value_t>
1033  static void is_not_empty(const value_t& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1034  try {
1035  collection_assert::is_not_empty(value, message, stack_frame);
1036  } catch (...) {
1037  base_assert::error();
1038  }
1039  }
1040 
1042  template<typename value_t>
1043  static void is_not_empty(const std::initializer_list<value_t>& value) {is_not_empty(value, "", xtd::diagnostics::stack_frame::empty());}
1044  template<typename value_t>
1045  static void is_not_empty(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_empty(value, "", stack_frame);}
1046  template<typename value_t>
1047  static void is_not_empty(const std::initializer_list<value_t>& value, const std::string& message) {is_not_empty(value, message, xtd::diagnostics::stack_frame::empty());}
1048  template<typename value_t>
1049  static void is_not_empty(const std::initializer_list<value_t>& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1050  try {
1051  collection_assert::is_not_empty(value, message, stack_frame);
1052  } catch (...) {
1053  base_assert::error();
1054  }
1055  }
1057 
1067  template<typename value_t>
1068  static void is_ordered(const value_t& value) {is_ordered(value, "", xtd::diagnostics::stack_frame::empty());}
1069 
1080  template<typename value_t>
1081  static void is_ordered(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_ordered(value, "", stack_frame);}
1082 
1093  template<typename value_t>
1094  static void is_ordered(const value_t& value, const std::string& message) {is_ordered(value, message, xtd::diagnostics::stack_frame::empty());}
1095 
1107  template<typename value_t>
1108  static void is_ordered(const value_t& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1109  try {
1110  collection_assert::is_ordered(value, message, stack_frame);
1111  } catch (...) {
1112  base_assert::error();
1113  }
1114  }
1115 
1117  template<typename value_t>
1118  static void is_ordered(const std::initializer_list<value_t>& value) {is_ordered(value, "", xtd::diagnostics::stack_frame::empty());}
1119  template<typename value_t>
1120  static void is_ordered(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame) {is_ordered(value, "", stack_frame);}
1121  template<typename value_t>
1122  static void is_ordered(const std::initializer_list<value_t>& value, const std::string& message) {is_ordered(value, message, xtd::diagnostics::stack_frame::empty());}
1123  template<typename value_t>
1124  static void is_ordered(const std::initializer_list<value_t>& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1125  try {
1126  collection_assert::is_ordered(value, message, stack_frame);
1127  } catch (...) {
1128  base_assert::error();
1129  }
1130  }
1132  };
1133  }
1134 }
static void is_ordered(const value_t &value, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection is ordered.
Definition: collection_valid.h:1108
static void are_equivalent(const expected_t &expected, const actual_t &actual)
Asserts that all collection items are equivalent.
Definition: collection_assert.h:406
The base class for assert.
Definition: base_assert.h:25
static void is_empty(const value_t &value, const std::string &message)
Validates that collection contains an item.
Definition: collection_valid.h:944
static void are_equivalent(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are equivalent.
Definition: collection_valid.h:410
static void are_equal(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are equal.
Definition: collection_valid.h:316
static void all_items_are_unique(const collection_t &collection)
Validates that all collection items are unique.
Definition: collection_valid.h:199
static void are_equivalent(const expected_t &expected, const actual_t &actual)
Validates that all collection items are equivalent.
Definition: collection_valid.h:384
static void is_ordered(const value_t &value)
Asserts that collection is ordered.
Definition: collection_assert.h:1150
static void is_empty(const value_t &value, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains an item.
Definition: collection_valid.h:958
static void is_ordered(const value_t &value)
Validates that collection is ordered.
Definition: collection_valid.h:1068
static void is_empty(const value_t &value)
Validates that collection contains an item.
Definition: collection_valid.h:918
static void are_not_equivalent(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are not equivalent.
Definition: collection_valid.h:624
static void is_not_empty(const value_t &value)
Validates that collection does not contain any item.
Definition: collection_valid.h:993
static void are_equal(const expected_t &expected, const actual_t &actual)
Asserts that all collection items are equal.
Definition: collection_assert.h:299
static void all_items_are_unique(const collection_t &collection, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are unique.
Definition: collection_valid.h:241
static void contains(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains all items.
Definition: collection_valid.h:744
static void are_not_equal(const expected_t &expected, const actual_t &actual)
Asserts that all collection items are not equal.
Definition: collection_assert.h:529
static void does_not_contain(const expected_t &expected, const actual_t &actual)
Validates that collection contains all items.
Definition: collection_valid.h:812
static void all_items_are_not_null(const collection_t &collection, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are not null.
Definition: collection_valid.h:162
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
static void contains(const expected_t &expected, const actual_t &actual)
Asserts that collection contains all items.
Definition: collection_assert.h:759
static void are_equivalent(const expected_t &expected, const actual_t &actual, const std::string &message)
Validates that all collection items are equivalent.
Definition: collection_valid.h:397
static void all_items_are_instances_of(const collection_t &collection, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are of the type supplied or a derived type.
Definition: collection_valid.h:79
static void are_not_equivalent(const expected_t &expected, const actual_t &actual, const std::string &message)
Validates that all collection items are not equivalent.
Definition: collection_valid.h:611
static void contains(const expected_t &expected, const actual_t &actual, const std::string &message)
Validates that collection contains all items.
Definition: collection_valid.h:718
The collection_valid class contains a collection of static methods that implement the most collection...
Definition: collection_valid.h:23
static void is_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains an item.
Definition: collection_valid.h:931
static void is_empty(const value_t &value)
Asserts that collection contains an item.
Definition: collection_assert.h:996
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are not equal.
Definition: collection_valid.h:517
static void are_not_equal(const expected_t &expected, const actual_t &actual, const std::string &message)
Validates that all collection items are not equal.
Definition: collection_valid.h:504
static void are_not_equal(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are not equal.
Definition: collection_valid.h:530
static void is_not_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection or traits does not contain any item.
Definition: collection_valid.h:1006
static void are_equal(const expected_t &expected, const actual_t &actual)
Validates that all collection items are equal.
Definition: collection_valid.h:277
static void does_not_contain(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains all items.
Definition: collection_valid.h:838
static void is_not_empty(const value_t &value, const std::string &message)
Validates that collection or traits does not contain any item.
Definition: collection_valid.h:1019
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are equal.
Definition: collection_valid.h:303
static void are_not_equivalent(const expected_t &expected, const actual_t &actual)
Asserts that all collection items are not equivalent.
Definition: collection_assert.h:636
Contains xtd::tunit::collection_valid class.
static void is_ordered(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection is ordered.
Definition: collection_valid.h:1081
static void all_items_are_not_null(const collection_t &collection, const std::string &message)
Validates that all collection items are not null.
Definition: collection_valid.h:132
static void all_items_are_instances_of(const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are of the type supplied or a derived type.
Definition: collection_valid.h:66
static void all_items_are_not_null(const collection_t &collection)
Asserts that all collection items are not null.
Definition: collection_assert.h:124
static void contains(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains all items.
Definition: collection_valid.h:731
static void are_equal(const expected_t &expected, const actual_t &actual, const std::string &message)
Validates that all collection items are equal.
Definition: collection_valid.h:290
static void is_not_empty(const value_t &value, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection or traits does not contain any item.
Definition: collection_valid.h:1033
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:34
static stack_frame empty() noexcept
Return an empty stack frame.
static void is_ordered(const value_t &value, const std::string &message)
Validates that collection is ordered.
Definition: collection_valid.h:1094
Contains xtd::tunit::valid class.
static void all_items_are_instances_of(const collection_t &collection, const std::string &message)
Validates that all collection items are of the type supplied or a derived type.
Definition: collection_valid.h:53
static void does_not_contain(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that collection contains all items.
Definition: collection_valid.h:851
static void are_not_equivalent(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are not equivalent.
Definition: collection_valid.h:637
static void are_equivalent(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are equivalent.
Definition: collection_valid.h:423
static void does_not_contain(const expected_t &expected, const actual_t &actual, const std::string &message)
Validates that collection contains all items.
Definition: collection_valid.h:825
static void all_items_are_unique(const collection_t &collection)
Asserts that all collection items are unique.
Definition: collection_assert.h:212
static void all_items_are_instances_of(const collection_t &collection)
Validates that all collection items are of the type supplied or a derived type.
Definition: collection_valid.h:40
static void contains(const expected_t &expected, const actual_t &actual)
Validates that collection contains all items.
Definition: collection_valid.h:705
static void all_items_are_not_null(const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are not null.
Definition: collection_valid.h:147
static void are_not_equal(const expected_t &expected, const actual_t &actual)
Validates that all collection items are not equal.
Definition: collection_valid.h:491
static void all_items_are_unique(const collection_t &collection, const std::string &message)
Validates that all collection items are unique.
Definition: collection_valid.h:213
static void all_items_are_not_null(const collection_t &collection)
Validates that all collection items are not null.
Definition: collection_valid.h:117
static void all_items_are_unique(const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Validates that all collection items are unique.
Definition: collection_valid.h:227
static void are_not_equivalent(const expected_t &expected, const actual_t &actual)
Validates that all collection items are not equivalent.
Definition: collection_valid.h:598
static void does_not_contain(const expected_t &expected, const actual_t &actual)
Asserts that collection contains all items.
Definition: collection_assert.h:878
static void is_not_empty(const value_t &value)
Asserts that collection does not contain any item.
Definition: collection_assert.h:1073