@@ -635,6 +635,9 @@ var collection = new[] { 1, 2, 3 };
635635
636636// old assertion:
637637CollectionAssert .Contains (collection , 2 );
638+ Assert .That (collection , Has .Member (2 ));
639+ Assert .That (collection , Does .Contain (2 ));
640+ Assert .That (collection , Contains .Item (2 ));
638641
639642// new assertion:
640643collection .Should ().Contain (2 );
@@ -650,6 +653,14 @@ CollectionAssert.Contains(collection, 4); /* fail message: Assert.That(collect
650653 Expected: some item equal to 4
651654 But was: < 1, 2, 3 >
652655 */
656+ Assert .That (collection , Has .Member (4 )); /* fail message: Assert.That(collection, Has.Member(4))
657+ Expected: some item equal to 4
658+ But was: < 1, 2, 3 >
659+ */
660+ Assert .That (collection , Does .Contain (4 )); /* fail message: Assert.That(collection, Does.Contain(4))
661+ Expected: some item equal to 4
662+ But was: < 1, 2, 3 >
663+ */
653664
654665// new assertion:
655666collection .Should ().Contain (4 ); /* fail message: Expected collection {1, 2, 3} to contain 4. */
@@ -664,6 +675,8 @@ object item = 2;
664675
665676// old assertion:
666677CollectionAssert .Contains (collection , item );
678+ Assert .That (collection , Has .Member (item ));
679+ Assert .That (collection , Does .Contain (item ));
667680
668681// new assertion:
669682collection .Should ().Contain ((int )item );
@@ -676,10 +689,22 @@ var collection = new[] { 1, 2, 3 };
676689object item = 4 ;
677690
678691// old assertion:
692+ Assert .That (collection , Contains .Item (item )); /* fail message: Assert.That(collection, Contains.Item(item))
693+ Expected: some item equal to 4
694+ But was: < 1, 2, 3 >
695+ */
679696CollectionAssert .Contains (collection , item ); /* fail message: Assert.That(collection, Has.Member(actual))
680697 Expected: some item equal to 4
681698 But was: < 1, 2, 3 >
682699 */
700+ Assert .That (collection , Has .Member (item )); /* fail message: Assert.That(collection, Has.Member(item))
701+ Expected: some item equal to 4
702+ But was: < 1, 2, 3 >
703+ */
704+ Assert .That (collection , Does .Contain (item )); /* fail message: Assert.That(collection, Does.Contain(item))
705+ Expected: some item equal to 4
706+ But was: < 1, 2, 3 >
707+ */
683708
684709// new assertion:
685710collection .Should ().Contain ((int )item ); /* fail message: Expected collection {1, 2, 3} to contain 4. */
@@ -693,6 +718,8 @@ var collection = new[] { 1, 2, 3 };
693718
694719// old assertion:
695720CollectionAssert .DoesNotContain (collection , 4 );
721+ Assert .That (collection , Has .No .Member (4 ));
722+ Assert .That (collection , Does .Not .Contain (4 ));
696723
697724// new assertion:
698725collection .Should ().NotContain (4 );
@@ -708,6 +735,14 @@ CollectionAssert.DoesNotContain(collection, 2); /* fail message: Assert.That(c
708735 Expected: not some item equal to 2
709736 But was: < 1, 2, 3 >
710737 */
738+ Assert .That (collection , Has .No .Member (2 )); /* fail message: Assert.That(collection, Has.No.Member(2))
739+ Expected: not some item equal to 2
740+ But was: < 1, 2, 3 >
741+ */
742+ Assert .That (collection , Does .Not .Contain (2 )); /* fail message: Assert.That(collection, Does.Not.Contain(2))
743+ Expected: not some item equal to 2
744+ But was: < 1, 2, 3 >
745+ */
711746
712747// new assertion:
713748collection .Should ().NotContain (2 ); /* fail message: Expected collection {1, 2, 3} to not contain 2. */
@@ -722,6 +757,8 @@ object item = 4;
722757
723758// old assertion:
724759CollectionAssert .DoesNotContain (collection , item );
760+ Assert .That (collection , Has .No .Member (item ));
761+ Assert .That (collection , Does .Not .Contain (item ));
725762
726763// new assertion:
727764collection .Should ().NotContain ((int )item );
@@ -738,6 +775,14 @@ CollectionAssert.DoesNotContain(collection, item); /* fail message: Assert.Tha
738775 Expected: not some item equal to 2
739776 But was: < 1, 2, 3 >
740777 */
778+ Assert .That (collection , Has .No .Member (item )); /* fail message: Assert.That(collection, Has.No.Member(item))
779+ Expected: not some item equal to 2
780+ But was: < 1, 2, 3 >
781+ */
782+ Assert .That (collection , Does .Not .Contain (item )); /* fail message: Assert.That(collection, Does.Not.Contain(item))
783+ Expected: not some item equal to 2
784+ But was: < 1, 2, 3 >
785+ */
741786
742787// new assertion:
743788collection .Should ().NotContain ((int )item ); /* fail message: Expected collection {1, 2, 3} to not contain 2. */
0 commit comments