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.
Loading...
Searching...
No Matches
collection_assert.h
Go to the documentation of this file.
1
4#pragma once
5#include "assert.h"
6
8namespace xtd {
10 namespace tunit {
20 class collection_assert final : private base_assert {
21 public:
23 collection_assert() = delete;
25
37 template<typename expected_t, typename collection_t>
38 static void all_items_are_instances_of(const collection_t& collection) {all_items_are_instances_of<expected_t>(collection, "", xtd::diagnostics::stack_frame::empty());}
39
51 template<typename expected_t, typename collection_t>
52 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());}
53
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
79 template<typename expected_t, typename collection_t>
80 static void all_items_are_instances_of(const collection_t& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
81 for (auto item : collection)
82 if (dynamic_cast<expected_t>(item) == nullptr) {
83 base_assert::fail("all items instance of <" + __tunit_demangle(typeid(expected_t).name()) + ">", base_assert::join_items(collection), message, stack_frame);
84 return;
85 }
86 assert::succeed(message, stack_frame);
87 }
88
90 template<typename expected_t, typename item_t>
91 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());}
92 template<typename expected_t, typename item_t>
93 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());}
94 template<typename expected_t, typename item_t>
95 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);}
96 template<typename expected_t, typename item_t>
97 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) {
98 for (auto item : collection)
99 if (dynamic_cast<expected_t>(item) == nullptr) {
100 base_assert::fail("all items instance of <" + __tunit_demangle(typeid(expected_t).name()) + ">", base_assert::join_items(collection), message, stack_frame);
101 return;
102 }
103 assert::succeed(message, stack_frame);
104 }
106
120 template<typename collection_t>
121 static void all_items_are_not_null(const collection_t& collection) {all_items_are_not_null(collection, "", xtd::diagnostics::stack_frame::empty());}
122
136 template<typename collection_t>
137 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());}
138
152 template<typename collection_t>
153 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);}
154
168 template<typename collection_t>
169 static void all_items_are_not_null(const collection_t& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
170 for (auto item : collection)
171 if (item == nullptr) {
172 base_assert::fail("all items are not null", base_assert::join_items(collection), message, stack_frame);
173 return;
174 }
175 assert::succeed(message, stack_frame);
176 }
177
179 template<typename item_t>
180 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());}
181 template<typename item_t>
182 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());}
183 template<typename item_t>
184 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);}
185 template<typename item_t>
186 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) {
187 for (auto item : collection)
188 if (item == nullptr) {
189 base_assert::fail("all items are not null", base_assert::join_items(collection), message, stack_frame);
190 return;
191 }
192 assert::succeed(message, stack_frame);
193 }
195
208 template<typename collection_t>
209 static void all_items_are_unique(const collection_t& collection) {all_items_are_unique(collection, "", xtd::diagnostics::stack_frame::empty());}
210
223 template<typename collection_t>
224 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());}
225
238 template<typename collection_t>
239 static void all_items_are_unique(const collection_t& collection, const xtd::diagnostics::stack_frame& stack_frame) {all_items_are_unique(collection, "", stack_frame);}
240
253 template<typename collection_t>
254 static void all_items_are_unique(const collection_t& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
255 auto value = *collection.cbegin();
256 std::map<decltype(value), int> counts;
257 for (auto item : collection) {
258 auto result = counts.insert(std::pair<decltype(item), int>(item, 1));
259 if (result.second == false)
260 base_assert::fail("all items are unique", base_assert::join_items(collection), message, stack_frame);
261 }
262 assert::succeed(message, stack_frame);
263 }
264
266 template<typename item_t>
267 static void all_items_are_unique(const std::initializer_list<item_t>& collection) {all_items_are_unique(collection, "", xtd::diagnostics::stack_frame::empty());}
268 template<typename item_t>
269 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);}
270 template<typename item_t>
271 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());}
272 template<typename item_t>
273 static void all_items_are_unique(const std::initializer_list<item_t>& collection, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
274 std::map<item_t, int> counts;
275 for (auto item : collection) {
276 auto result = counts.insert(std::pair<item_t, int>(item, 1));
277 if (result.second == false)
278 base_assert::fail("all items are unique", base_assert::join_items(collection), message, stack_frame);
279 }
280 assert::succeed(message, stack_frame);
281 }
283
295 template<typename expected_t, typename actual_t>
296 static void are_equal(const expected_t& expected, const actual_t& actual) {are_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
297
309 template<typename expected_t, typename actual_t>
310 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());}
311
323 template<typename expected_t, typename actual_t>
324 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);}
325
337 template<typename expected_t, typename actual_t>
338 static void are_equal(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
339 if (std::equal(actual.begin(), actual.end(), expected.begin(), expected.end()) == false)
340 base_assert::fail(base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
341 else
342 assert::succeed(message, stack_frame);
343 }
344
346 template<typename item_t>
347 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());}
348 template<typename item_t>
349 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);}
350 template<typename item_t>
351 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());}
352 template<typename item_t>
353 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) {
354 if (std::equal(actual.begin(), actual.end(), expected.begin(), expected.end()) == false)
355 base_assert::fail(base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
356 else
357 assert::succeed(message, stack_frame);
358 }
359
361 template<typename collection_t, typename item_t>
362 static void are_equal(const collection_t& expected, const std::initializer_list<item_t>& actual) {are_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
363 template<typename collection_t, typename item_t>
364 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);}
365 template<typename collection_t, typename item_t>
366 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());}
367 template<typename collection_t, typename item_t>
368 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) {
369 if (std::equal(actual.begin(), actual.end(), expected.begin(), expected.end()) == false)
370 base_assert::fail(base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
371 else
372 assert::succeed(message, stack_frame);
373 }
374
376 template<typename item_t, typename collection_t>
377 static void are_equal(const std::initializer_list<item_t>& expected, const collection_t& actual) {are_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
378 template<typename item_t, typename collection_t>
379 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);}
380 template<typename item_t, typename collection_t>
381 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());}
382 template<typename item_t, typename collection_t>
383 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) {
384 if (std::equal(actual.begin(), actual.end(), expected.begin(), expected.end()) == false)
385 base_assert::fail(base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
386 else
387 assert::succeed(message, stack_frame);
388 }
390
402 template<typename expected_t, typename actual_t>
403 static void are_equivalent(const expected_t& expected, const actual_t& actual) {are_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
404
416 template<typename expected_t, typename actual_t>
417 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());}
418
430 template<typename expected_t, typename actual_t>
431 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);}
432
444 template<typename expected_t, typename actual_t>
445 static void are_equivalent(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
446 expected_t expect_sorted = expected;
447 std::sort(expect_sorted.begin(), expect_sorted.end());
448 expected_t actual_sorted = actual;
449 std::sort(actual_sorted.begin(), actual_sorted.end());
450 if (std::equal(actual_sorted.begin(), actual_sorted.end(), expect_sorted.begin(), expect_sorted.end()) == false)
451 base_assert::fail("equivalent " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
452 else
453 assert::succeed(message, stack_frame);
454 }
455
457 template<typename expected_t, typename actual_t>
458 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());}
459 template<typename expected_t, typename actual_t>
460 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);}
461 template<typename expected_t, typename actual_t>
462 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());}
463 template<typename expected_t, typename actual_t>
464 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) {
465 std::vector<expected_t> expect_sorted = expected;
466 std::sort(expect_sorted.begin(), expect_sorted.end());
467 std::vector<actual_t> actual_sorted = actual;
468 std::sort(actual_sorted.begin(), actual_sorted.end());
469 if (std::equal(actual_sorted.begin(), actual_sorted.end(), expect_sorted.begin(), expect_sorted.end()) == false)
470 base_assert::fail("equivalent " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
471 else
472 assert::succeed(message, stack_frame);
473 }
474
476 template<typename collection_t, typename item_t>
477 static void are_equivalent(const collection_t& expected, const std::initializer_list<item_t>& actual) {are_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
478 template<typename collection_t, typename item_t>
479 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);}
480 template<typename collection_t, typename item_t>
481 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());}
482 template<typename collection_t, typename item_t>
483 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) {
484 collection_t expect_sorted = expected;
485 std::sort(expect_sorted.begin(), expect_sorted.end());
486 std::vector<item_t> actual_sorted = actual;
487 std::sort(actual_sorted.begin(), actual_sorted.end());
488 if (std::equal(actual_sorted.begin(), actual_sorted.end(), expect_sorted.begin(), expect_sorted.end()) == false)
489 base_assert::fail("equivalent " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
490 else
491 assert::succeed(message, stack_frame);
492 }
493
495 template<typename item_t, typename collection_t>
496 static void are_equivalent(const std::initializer_list<item_t>& expected, const collection_t& actual) {are_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
497 template<typename item_t, typename collection_t>
498 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);}
499 template<typename item_t, typename collection_t>
500 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());}
501 template<typename item_t, typename collection_t>
502 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) {
503 std::vector<item_t> expect_sorted = expected;
504 std::sort(expect_sorted.begin(), expect_sorted.end());
505 collection_t actual_sorted = actual;
506 std::sort(actual_sorted.begin(), actual_sorted.end());
507 if (std::equal(actual_sorted.begin(), actual_sorted.end(), expect_sorted.begin(), expect_sorted.end()) == false)
508 base_assert::fail("equivalent " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
509 else
510 assert::succeed(message, stack_frame);
511 }
513
525 template<typename expected_t, typename actual_t>
526 static void are_not_equal(const expected_t& expected, const actual_t& actual) {are_not_equal(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
527
539 template<typename expected_t, typename actual_t>
540 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());}
541
553 template<typename expected_t, typename actual_t>
554 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);}
555
567 template<typename expected_t, typename actual_t>
568 static void are_not_equal(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
569 if (std::equal(actual.begin(), actual.end(), expected.begin(), expected.end()) == true)
570 base_assert::fail("not " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
571 else
572 assert::succeed(message, stack_frame);
573 }
574
576 template<typename item_t>
577 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());}
578 template<typename item_t>
579 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);}
580 template<typename item_t>
581 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());}
582 template<typename item_t>
583 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) {
584 if (std::equal(actual.begin(), actual.end(), expected.begin(), expected.end()) == true)
585 base_assert::fail("not " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
586 else
587 assert::succeed(message, stack_frame);
588 }
589
591 template<typename collection_t, typename item_t>
592 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());}
593 template<typename collection_t, typename item_t>
594 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);}
595 template<typename collection_t, typename item_t>
596 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());}
597 template<typename collection_t, typename item_t>
598 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) {
599 if (std::equal(actual.begin(), actual.end(), expected.begin(), expected.end()) == true)
600 base_assert::fail("not " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
601 else
602 assert::succeed(message, stack_frame);
603 }
604
606 template<typename item_t, typename collection_t>
607 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());}
608 template<typename item_t, typename collection_t>
609 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);}
610 template<typename item_t, typename collection_t>
611 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());}
612 template<typename item_t, typename collection_t>
613 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) {
614 if (std::equal(actual.begin(), actual.end(), expected.begin(), expected.end()) == true)
615 base_assert::fail("not " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
616 else
617 assert::succeed(message, stack_frame);
618 }
620
632 template<typename expected_t, typename actual_t>
633 static void are_not_equivalent(const expected_t& expected, const actual_t& actual) {are_not_equivalent(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
634
646 template<typename expected_t, typename actual_t>
647 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());}
648
660 template<typename expected_t, typename actual_t>
661 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);}
662
674 template<typename expected_t, typename actual_t>
675 static void are_not_equivalent(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
676 expected_t expect_sorted = expected;
677 std::sort(expect_sorted.begin(), expect_sorted.end());
678 expected_t actual_sorted = actual;
679 std::sort(actual_sorted.begin(), actual_sorted.end());
680 if (std::equal(actual_sorted.begin(), actual_sorted.end(), expect_sorted.begin(), expect_sorted.end()) == true)
681 base_assert::fail("not equivalent " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
682 else
683 assert::succeed(message, stack_frame);
684 }
685
687 template<typename expected_t, typename actual_t>
688 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());}
689 template<typename expected_t, typename actual_t>
690 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);}
691 template<typename expected_t, typename actual_t>
692 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());}
693 template<typename expected_t, typename actual_t>
694 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) {
695 std::vector<expected_t> expect_sorted = expected;
696 std::sort(expect_sorted.begin(), expect_sorted.end());
697 std::vector<actual_t> actual_sorted = actual;
698 std::sort(actual_sorted.begin(), actual_sorted.end());
699 if (std::equal(actual_sorted.begin(), actual_sorted.end(), expect_sorted.begin(), expect_sorted.end()) == true)
700 base_assert::fail("not equivalent " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
701 else
702 assert::succeed(message, stack_frame);
703 }
704
706 template<typename collection_t, typename item_t>
707 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());}
708 template<typename collection_t, typename item_t>
709 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);}
710 template<typename collection_t, typename item_t>
711 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());}
712 template<typename collection_t, typename item_t>
713 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) {
714 collection_t expect_sorted = expected;
715 std::sort(expect_sorted.begin(), expect_sorted.end());
716 std::vector<item_t> actual_sorted = actual;
717 std::sort(actual_sorted.begin(), actual_sorted.end());
718 if (std::equal(actual_sorted.begin(), actual_sorted.end(), expect_sorted.begin(), expect_sorted.end()) == true)
719 base_assert::fail("not equivalent " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
720 else
721 assert::succeed(message, stack_frame);
722 }
723
725 template<typename item_t, typename collection_t>
726 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());}
727 template<typename item_t, typename collection_t>
728 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);}
729 template<typename item_t, typename collection_t>
730 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());}
731 template<typename item_t, typename collection_t>
732 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) {
733 std::vector<item_t> expect_sorted = expected;
734 std::sort(expect_sorted.begin(), expect_sorted.end());
735 collection_t actual_sorted = actual;
736 std::sort(actual_sorted.begin(), actual_sorted.end());
737 if (std::equal(actual_sorted.begin(), actual_sorted.end(), expect_sorted.begin(), expect_sorted.end()) == true)
738 base_assert::fail("not equivalent " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
739 else
740 assert::succeed(message, stack_frame);
741 }
743
755 template<typename expected_t, typename actual_t>
756 static void contains(const expected_t& expected, const actual_t& actual) {contains(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
757
769 template<typename expected_t, typename actual_t>
770 static void contains(const expected_t& expected, const actual_t& actual, const std::string& message) {contains(expected, actual, message, xtd::diagnostics::stack_frame::empty());}
771
783 template<typename expected_t, typename actual_t>
784 static void contains(const expected_t& expected, const actual_t& actual, const xtd::diagnostics::stack_frame& stack_frame) {contains(expected, actual, "", stack_frame);}
785
797 template<typename expected_t, typename actual_t>
798 static void contains(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
799 for (auto item : expected) {
800 if (std::find(actual.begin(), actual.end(), item) == actual.end()) {
801 base_assert::fail("contains " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
802 return;
803 }
804 }
805 assert::succeed(message, stack_frame);
806 }
807
809 template<typename item_t>
810 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());}
811 template<typename item_t>
812 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);}
813 template<typename item_t>
814 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());}
815 template<typename item_t>
816 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) {
817 for (auto item : expected) {
818 if (std::find(actual.begin(), actual.end(), item) == actual.end()) {
819 base_assert::fail("contains " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
820 return;
821 }
822 }
823 assert::succeed(message, stack_frame);
824 }
825
827 template<typename collection_t, typename item_t>
828 static void contains(const collection_t& expected, const std::initializer_list<item_t>& actual) {contains(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
829 template<typename collection_t, typename item_t>
830 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);}
831 template<typename collection_t, typename item_t>
832 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());}
833 template<typename collection_t, typename item_t>
834 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) {
835 for (auto item : expected) {
836 if (std::find(actual.begin(), actual.end(), item) == actual.end()) {
837 base_assert::fail("contains " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
838 return;
839 }
840 }
841 assert::succeed(message, stack_frame);
842 }
843
845 template<typename item_t, typename collection_t>
846 static void contains(const std::initializer_list<item_t>& expected, const collection_t& actual) {contains(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
847 template<typename item_t, typename collection_t>
848 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);}
849 template<typename item_t, typename collection_t>
850 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());}
851 template<typename item_t, typename collection_t>
852 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) {
853 for (auto item : expected) {
854 if (std::find(actual.begin(), actual.end(), item) == actual.end()) {
855 base_assert::fail("contains " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
856 return;
857 }
858 }
859 assert::succeed(message, stack_frame);
860 }
862
874 template<typename expected_t, typename actual_t>
875 static void does_not_contain(const expected_t& expected, const actual_t& actual) {does_not_contain(expected, actual, "", xtd::diagnostics::stack_frame::empty());}
876
888 template<typename expected_t, typename actual_t>
889 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());}
890
902 template<typename expected_t, typename actual_t>
903 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);}
904
916 template<typename expected_t, typename actual_t>
917 static void does_not_contain(const expected_t& expected, const actual_t& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
918 for (auto item : expected) {
919 if (std::find(actual.begin(), actual.end(), item) == actual.end()) {
920 assert::succeed(message, stack_frame);
921 return;
922 }
923 }
924 base_assert::fail("not contains " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
925 }
926
928 template<typename item_t>
929 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());}
930 template<typename item_t>
931 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);}
932 template<typename item_t>
933 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());}
934 template<typename item_t>
935 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) {
936 for (auto item : expected) {
937 if (std::find(actual.begin(), actual.end(), item) == actual.end()) {
938 assert::succeed(message, stack_frame);
939 return;
940 }
941 }
942 base_assert::fail("not contains " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
943 }
944
946 template<typename collection_t, typename item_t>
947 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());}
948 template<typename collection_t, typename item_t>
949 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);}
950 template<typename collection_t, typename item_t>
951 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());}
952 template<typename collection_t, typename item_t>
953 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) {
954 for (auto item : expected) {
955 if (std::find(actual.begin(), actual.end(), item) == actual.end()) {
956 assert::succeed(message, stack_frame);
957 return;
958 }
959 }
960 base_assert::fail("not contains " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
961 }
962
964 template<typename item_t, typename collection_t>
965 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());}
966 template<typename item_t, typename collection_t>
967 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);}
968 template<typename item_t, typename collection_t>
969 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());}
970 template<typename item_t, typename collection_t>
971 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) {
972 for (auto item : expected) {
973 if (std::find(actual.begin(), actual.end(), item) == actual.end()) {
974 assert::succeed(message, stack_frame);
975 return;
976 }
977 }
978 base_assert::fail("not contains " + base_assert::join_items(expected), base_assert::join_items(actual), message, stack_frame);
979 }
981
992 template<typename value_t>
993 static void is_empty(const value_t& value) {is_empty(value, "", xtd::diagnostics::stack_frame::empty());}
994
1006 template<typename value_t>
1007 static void is_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_empty(value, "", stack_frame);}
1008
1020 template<typename value_t>
1021 static void is_empty(const value_t& value, const std::string& message) {is_empty(value, message, xtd::diagnostics::stack_frame::empty());}
1022
1035 template<typename value_t>
1036 static void is_empty(const value_t& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1037 if (std::empty(value))
1038 assert::succeed(message, stack_frame);
1039 else
1040 base_assert::fail("<empty>", base_assert::join_items(value), message, stack_frame);
1041 }
1042
1044 template<typename value_t>
1045 static void is_empty(const std::initializer_list<value_t>& value) {is_empty(value, "", xtd::diagnostics::stack_frame::empty());}
1046 template<typename value_t>
1047 static void is_empty(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame) {is_empty(value, "", stack_frame);}
1048 template<typename value_t>
1049 static void is_empty(const std::initializer_list<value_t>& value, const std::string& message) {is_empty(value, message, xtd::diagnostics::stack_frame::empty());}
1050 template<typename value_t>
1051 static void is_empty(const std::initializer_list<value_t>& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1052 if (std::empty(value))
1053 assert::succeed(message, stack_frame);
1054 else
1055 base_assert::fail("<empty>", base_assert::join_items(value), message, stack_frame);
1056 }
1058
1069 template<typename value_t>
1070 static void is_not_empty(const value_t& value) {is_not_empty(value, "", xtd::diagnostics::stack_frame::empty());}
1071
1083 template<typename value_t>
1084 static void is_not_empty(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_not_empty(value, "", stack_frame);}
1085
1097 template<typename value_t>
1098 static void is_not_empty(const value_t& value, const std::string& message) {is_not_empty(value, message, xtd::diagnostics::stack_frame::empty());}
1099
1112 template<typename value_t>
1113 static void is_not_empty(const value_t& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1114 if (!std::empty(value))
1115 assert::succeed(message, stack_frame);
1116 else
1117 base_assert::fail("not <empty>", "<empty>", message, stack_frame);
1118 }
1119
1121 template<typename value_t>
1122 static void is_not_empty(const std::initializer_list<value_t>& value) {is_not_empty(value, "", xtd::diagnostics::stack_frame::empty());}
1123 template<typename value_t>
1124 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);}
1125 template<typename value_t>
1126 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());}
1127 template<typename value_t>
1128 static void is_not_empty(const std::initializer_list<value_t>& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1129 if (!std::empty(value))
1130 assert::succeed(message, stack_frame);
1131 else
1132 base_assert::fail("not <empty>", "<empty>", message, stack_frame);
1133 }
1135
1146 template<typename value_t>
1147 static void is_ordered(const value_t& value) {is_ordered(value, "", xtd::diagnostics::stack_frame::empty());}
1148
1160 template<typename value_t>
1161 static void is_ordered(const value_t& value, const xtd::diagnostics::stack_frame& stack_frame) {is_ordered(value, "", stack_frame);}
1162
1174 template<typename value_t>
1175 static void is_ordered(const value_t& value, const std::string& message) {is_ordered(value, message, xtd::diagnostics::stack_frame::empty());}
1176
1189 template<typename value_t>
1190 static void is_ordered(const value_t& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1191 if (std::is_sorted(value.begin(), value.end()))
1192 assert::succeed(message, stack_frame);
1193 else
1194 base_assert::fail("<ordered>", base_assert::join_items(value), message, stack_frame);
1195 }
1196
1198 template<typename value_t>
1199 static void is_ordered(const std::initializer_list<value_t>& value) {is_ordered(value, "", xtd::diagnostics::stack_frame::empty());}
1200 template<typename value_t>
1201 static void is_ordered(const std::initializer_list<value_t>& value, const xtd::diagnostics::stack_frame& stack_frame) {is_ordered(value, "", stack_frame);}
1202 template<typename value_t>
1203 static void is_ordered(const std::initializer_list<value_t>& value, const std::string& message) {is_ordered(value, message, xtd::diagnostics::stack_frame::empty());}
1204 template<typename value_t>
1205 static void is_ordered(const std::initializer_list<value_t>& value, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame) {
1206 if (std::is_sorted(value.begin(), value.end()))
1207 assert::succeed(message, stack_frame);
1208 else
1209 base_assert::fail("<ordered>", base_assert::join_items(value), message, stack_frame);
1210 }
1212 };
1213 }
1214}
1215
1216#define all_items_are_instances_of_(...) __CMD_ASSERT_ARGS(all_items_are_instances_of, __VA_ARGS__)
1217
1218#define all_items_are_not_null_(...) __CMD_ASSERT_ARGS(all_items_are_not_null, __VA_ARGS__)
1219
1220#define all_items_are_unique_(...) __CMD_ASSERT_ARGS(all_items_are_unique, __VA_ARGS__)
1221
1222#define are_equivalent_(...) __CMD_ASSERT_ARGS(are_equivalent, __VA_ARGS__)
1223
1224#define are_not_equivalent_(...) __CMD_ASSERT_ARGS(are_not_equivalent, __VA_ARGS__)
1225
1226#define is_ordered_(...) __CMD_ASSERT_ARGS(is_ordered, __VA_ARGS__)
Contains xtd::tunit::assert class.
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:29
static stack_frame empty() noexcept
Return an empty stack frame.
The base class for assert.
Definition: base_assert.h:25
static void fail()
Throws an xtd::tunit::assertion_error exception. This is used by the other Assert functions.
Definition: base_assert.h:70
static void succeed()
Generates a success with a generic message. This is used by the other Assert functions.
Definition: base_assert.h:140
The collection_assert class contains a collection of static methods that implement the most collectio...
Definition: collection_assert.h:20
static void is_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains an item.
Definition: collection_assert.h:1007
static void all_items_are_not_null(const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are not null.
Definition: collection_assert.h:153
static void are_not_equivalent(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are not equivalent.
Definition: collection_assert.h:675
static void all_items_are_unique(const collection_t &collection, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are unique.
Definition: collection_assert.h:254
static void does_not_contain(const expected_t &expected, const actual_t &actual)
Asserts that collection contains all items.
Definition: collection_assert.h:875
static void are_not_equivalent(const expected_t &expected, const actual_t &actual, const std::string &message)
Asserts that all collection items are not equivalent.
Definition: collection_assert.h:647
static void are_equal(const expected_t &expected, const actual_t &actual)
Asserts that all collection items are equal.
Definition: collection_assert.h:296
static void are_not_equivalent(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are not equivalent.
Definition: collection_assert.h:661
static void all_items_are_instances_of(const collection_t &collection, const std::string &message)
Asserts that all collection items are of the type supplied or a derived type.
Definition: collection_assert.h:52
static void is_ordered(const value_t &value, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection is ordered.
Definition: collection_assert.h:1190
static void all_items_are_unique(const collection_t &collection, const std::string &message)
Asserts that all collection items are unique.
Definition: collection_assert.h:224
static void are_equivalent(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are equivalent.
Definition: collection_assert.h:431
static void are_not_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are not equal.
Definition: collection_assert.h:554
static void is_not_empty(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection or traits does not contain any item.
Definition: collection_assert.h:1084
static void contains(const expected_t &expected, const actual_t &actual, const std::string &message)
Asserts that collection contains all items.
Definition: collection_assert.h:770
static void is_ordered(const value_t &value, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection is ordered.
Definition: collection_assert.h:1161
static void are_equal(const expected_t &expected, const actual_t &actual, const std::string &message)
Asserts that all collection items are equal.
Definition: collection_assert.h:310
static void is_not_empty(const value_t &value, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection or traits does not contain any item.
Definition: collection_assert.h:1113
static void is_not_empty(const value_t &value, const std::string &message)
Asserts that collection or traits does not contain any item.
Definition: collection_assert.h:1098
static void are_equivalent(const expected_t &expected, const actual_t &actual)
Asserts that all collection items are equivalent.
Definition: collection_assert.h:403
static void are_equivalent(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are equivalent.
Definition: collection_assert.h:445
static void does_not_contain(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains all items.
Definition: collection_assert.h:903
static void is_ordered(const value_t &value)
Asserts that collection is ordered.
Definition: collection_assert.h:1147
static void are_equal(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are equal.
Definition: collection_assert.h:338
static void all_items_are_unique(const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are unique.
Definition: collection_assert.h:239
static void are_equivalent(const expected_t &expected, const actual_t &actual, const std::string &message)
Asserts that all collection items are equivalent.
Definition: collection_assert.h:417
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:633
static void all_items_are_unique(const collection_t &collection)
Asserts that all collection items are unique.
Definition: collection_assert.h:209
static void contains(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains all items.
Definition: collection_assert.h:784
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:526
static void is_empty(const value_t &value, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains an item.
Definition: collection_assert.h:1036
static void all_items_are_not_null(const collection_t &collection, const std::string &message)
Asserts that all collection items are not null.
Definition: collection_assert.h:137
static void is_empty(const value_t &value)
Asserts that collection contains an item.
Definition: collection_assert.h:993
static void all_items_are_instances_of(const collection_t &collection, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are of the type supplied or a derived type.
Definition: collection_assert.h:80
static void all_items_are_instances_of(const collection_t &collection, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are of the type supplied or a derived type.
Definition: collection_assert.h:66
static void are_not_equal(const expected_t &expected, const actual_t &actual, const std::string &message)
Asserts that all collection items are not equal.
Definition: collection_assert.h:540
static void contains(const expected_t &expected, const actual_t &actual)
Asserts that collection contains all items.
Definition: collection_assert.h:756
static void contains(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains all items.
Definition: collection_assert.h:798
static void are_equal(const expected_t &expected, const actual_t &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are equal.
Definition: collection_assert.h:324
static void is_ordered(const value_t &value, const std::string &message)
Asserts that collection is ordered.
Definition: collection_assert.h:1175
static void all_items_are_instances_of(const collection_t &collection)
Asserts that all collection items are of the type supplied or a derived type.
Definition: collection_assert.h:38
static void all_items_are_not_null(const collection_t &collection, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are not null.
Definition: collection_assert.h:169
static void is_not_empty(const value_t &value)
Asserts that collection does not contain any item.
Definition: collection_assert.h:1070
static void does_not_contain(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that collection contains all items.
Definition: collection_assert.h:917
static void all_items_are_not_null(const collection_t &collection)
Asserts that all collection items are not null.
Definition: collection_assert.h:121
static void does_not_contain(const expected_t &expected, const actual_t &actual, const std::string &message)
Asserts that collection contains all items.
Definition: collection_assert.h:889
static void are_not_equal(const expected_t &expected, const actual_t &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that all collection items are not equal.
Definition: collection_assert.h:568
static void is_empty(const value_t &value, const std::string &message)
Asserts that collection contains an item.
Definition: collection_assert.h:1021
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17