public void Equivalent() { ICollection set1 = new ICollectionAdapter("x", "y", "z"); ICollection set2 = new ICollectionAdapter("z", "y", "x"); CollectionAssert.AreEquivalent(set1, set2); }
public void EquivalentHandlesNull() { ICollection set1 = new ICollectionAdapter(null, "x", null, "z"); ICollection set2 = new ICollectionAdapter("z", null, "x", null); Assert.That(new CollectionEquivalentConstraint(set1).Matches(set2)); }
public void EquivalentHonorsIgnoreCase() { ICollection set1 = new ICollectionAdapter("x", "y", "z"); ICollection set2 = new ICollectionAdapter("z", "Y", "X"); Assert.That(new CollectionEquivalentConstraint(set1).IgnoreCase.Matches(set2)); }
public void EquivalentFailsWithDuplicateElementInExpected() { ICollection set1 = new ICollectionAdapter("x", "y", "x"); ICollection set2 = new ICollectionAdapter("x", "y", "z"); Assert.False(new CollectionEquivalentConstraint(set1).Matches(set2)); }
public void EquivalentIgnoresOrder() { ICollection set1 = new ICollectionAdapter("x", "y", "z"); ICollection set2 = new ICollectionAdapter("z", "y", "x"); Assert.That(new CollectionEquivalentConstraint(set1).Matches(set2)); }
public void AreEquivalentHandlesNull() { ICollection set1 = new ICollectionAdapter(null, "x", null, "z"); ICollection set2 = new ICollectionAdapter("z", null, "x", null); CollectionAssert.AreEquivalent(set1, set2); }
public void ContainsFails_EmptyICollection() { ICollectionAdapter ca = new ICollectionAdapter(new object[0]); expectedMessage = " Expected: collection containing \"x\"" + Environment.NewLine + " But was: <empty>" + Environment.NewLine; CollectionAssert.Contains(ca, "x"); }
public void ContainsFails_ICollection() { ICollectionAdapter ca = new ICollectionAdapter(new string[] { "x", "y", "z" }); expectedMessage = " Expected: collection containing \"a\"" + Environment.NewLine + " But was: < \"x\", \"y\", \"z\" >" + Environment.NewLine; CollectionAssert.Contains(ca, "a"); }
public void EquivalentFailTwo() { ICollection set1 = new ICollectionAdapter("x", "y", "x"); ICollection set2 = new ICollectionAdapter("x", "y", "z"); expectedMessage = " Expected: equivalent to < \"x\", \"y\", \"x\" >" + Environment.NewLine + " But was: < \"x\", \"y\", \"z\" >" + Environment.NewLine; CollectionAssert.AreEquivalent(set1, set2); }
public void WorksWithCollectionsOfArrays() { byte[] array1 = new byte[] { 0x20, 0x44, 0x56, 0x76, 0x1e, 0xff }; byte[] array2 = new byte[] { 0x42, 0x52, 0x72, 0xef }; byte[] array3 = new byte[] { 0x20, 0x44, 0x56, 0x76, 0x1e, 0xff }; byte[] array4 = new byte[] { 0x42, 0x52, 0x72, 0xef }; ICollection set1 = new ICollectionAdapter(array1, array2); ICollection set2 = new ICollectionAdapter(array3, array4); Constraint constraint = new CollectionEquivalentConstraint(set1); Assert.That(constraint.Matches(set2)); set2 = new ICollectionAdapter(array4, array3); Assert.That(constraint.Matches(set2)); }
public void ContainsFails_ICollection() { ICollectionAdapter ca = new ICollectionAdapter( new string[] { "x", "y", "z" } ); expectedMessage = " Expected: collection containing \"a\"" + Environment.NewLine + " But was: < \"x\", \"y\", \"z\" >" + Environment.NewLine; CollectionAssert.Contains(ca,"a"); }
public void ContainsFails_EmptyICollection() { ICollectionAdapter ca = new ICollectionAdapter( new object[0] ); expectedMessage = " Expected: collection containing \"x\"" + Environment.NewLine + " But was: <empty>" + Environment.NewLine; CollectionAssert.Contains(ca,"x"); }
public void AreEquivalentHandlesNull() { ICollection set1 = new ICollectionAdapter( null, "x", null, "z" ); ICollection set2 = new ICollectionAdapter( "z", null, "x", null ); CollectionAssert.AreEquivalent(set1,set2); }
public void ContainsNull_ICollection() { ICollectionAdapter ca = new ICollectionAdapter(new object[] { 1, 2, 3, null, 4, 5 }); CollectionAssert.Contains(ca, null); }
public void ContainsNull_ICollection() { ICollectionAdapter ca = new ICollectionAdapter( new object[] { 1, 2, 3, null, 4, 5 } ); CollectionAssert.Contains( ca, null ); }
public void EquivalentHonorsUsing() { ICollection set1 = new ICollectionAdapter("x", "y", "z"); ICollection set2 = new ICollectionAdapter("z", "Y", "X"); Assert.That(new CollectionEquivalentConstraint(set1) .Using<string>((x, y) => String.Compare(x, y, true)) .Matches(set2)); }
public void Equivalent() { ICollection set1 = new ICollectionAdapter( "x", "y", "z" ); ICollection set2 = new ICollectionAdapter( "z", "y", "x" ); CollectionAssert.AreEquivalent(set1,set2); }
public void Contains_ICollection() { ICollectionAdapter ca = new ICollectionAdapter( new string[] { "x", "y", "z" } ); CollectionAssert.Contains(ca,"x"); }
public void Contains_ICollection() { ICollectionAdapter ca = new ICollectionAdapter(new string[] { "x", "y", "z" }); CollectionAssert.Contains(ca, "x"); }
public void EquivalentFailTwo() { ICollection set1 = new ICollectionAdapter( "x", "y", "x" ); ICollection set2 = new ICollectionAdapter( "x", "y", "z" ); expectedMessage = " Expected: equivalent to < \"x\", \"y\", \"x\" >" + Environment.NewLine + " But was: < \"x\", \"y\", \"z\" >" + Environment.NewLine; CollectionAssert.AreEquivalent(set1,set2); }
public void CanTestContentsOfCollectionNotImplementingIList() { ICollectionAdapter ints = new ICollectionAdapter(new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}); Assert.That(ints, new CollectionContainsConstraint( 9 )); }