public void WithNotStrictOrdering_OfShuffledCollections_ShouldBeEqual() { var firstCollection = new[] { "1", "2" }; var secondCollection = new[] { "2", "1" }; var firstByValue = new CollectionByValue <string>(firstCollection, NotStrictOptions); var secondByValue = new CollectionByValue <string>(secondCollection, NotStrictOptions); CollectionByValueAssert.AreEqual(firstByValue, secondByValue); }
public void OfCollectionsOfDifferentTypes_ShouldNotBeEqual() { var firstCollection = new byte[] { 1, 2 }; var secondCollection = new int[] { 1, 2 }; var firstByValue = new CollectionByValue <byte>(firstCollection, new Options <byte>(true, null)); var secondByValue = new CollectionByValue <int>(secondCollection, new Options <int>(true, null)); CollectionByValueAssert.AreNotEqual(firstByValue, secondByValue); }
public void WithStrictOrdering_OfCollectionsWithSameItems_ShouldBeEqual() { var firstCollection = new[] { "1", "2" }; var secondCollection = new[] { "1", "2" }; var firstByValue = new CollectionByValue <string>(firstCollection, StrictOptions); var secondByValue = new CollectionByValue <string>(secondCollection, StrictOptions); CollectionByValueAssert.AreEqual(firstByValue, secondByValue); }
public void OfNullCollectionsOfDifferentTypes_ShouldNotBeEqual() { var firstCollection = (string[])null; var secondCollection = (int[])null; var firstByValue = new CollectionByValue <string>(firstCollection, StrictOptions); var secondByValue = new CollectionByValue <int>(secondCollection, new Options <int>(true, null)); CollectionByValueAssert.AreNotEqual(firstByValue, secondByValue); }
public void OfEmptyCollection_ShouldNotBeEqualToOfNullCollection() { var firstCollection = new string[] { }; var secondCollection = (string[])null; var firstByValue = new CollectionByValue <string>(firstCollection, NotStrictOptions); var secondByValue = new CollectionByValue <string>(secondCollection, NotStrictOptions); CollectionByValueAssert.AreNotEqual(firstByValue, secondByValue); }
public void OfNullCollections_ShouldBeEqual() { var firstCollection = (string[])null; var secondCollection = (string[])null; var firstByValue = new CollectionByValue <string>(firstCollection, StrictOptions); var secondByValue = new CollectionByValue <string>(secondCollection, StrictOptions); CollectionByValueAssert.AreEqual(firstByValue, secondByValue); }
public void OfCollectionsWithDifferentOrdering_WithShuffledItems_ShouldNotBeEqual() { var firstCollection = new[] { "1", "2" }; var secondCollection = new[] { "2", "1" }; var firstByValue = new CollectionByValue <string>(firstCollection, StrictOptions); var secondByValue = new CollectionByValue <string>(secondCollection, NotStrictOptions); CollectionByValueAssert.AreNotEqual(firstByValue, secondByValue); }
public void OfNullSetsOfDifferentTypes_ShouldNotBeEqual() { var firstSet = (ISet <string>)null; var secondSet = (ISet <int>)null; var firstByValue = new SetByValue <string>(firstSet, Options); var secondByValue = new SetByValue <int>(secondSet, new Options <int>(true, null)); CollectionByValueAssert.AreNotEqual(firstByValue, secondByValue); }
public void OfNullSets_ShouldBeEqual() { var firstSet = (ISet <string>)null; var secondSet = (ISet <string>)null; var firstByValue = new SetByValue <string>(firstSet, Options); var secondByValue = new SetByValue <string>(secondSet, Options); CollectionByValueAssert.AreEqual(firstByValue, secondByValue); }
public void WithCustomComparer_ShouldUseComparer([Values] bool strictOrdering) { var firstCollection = new[] { "1", "2" }; var secondCollection = new[] { "1", "222" }; var comparer = new AlwaysEqualsEqualityComparer <string>(); var firstByValue = new CollectionByValue <string>(firstCollection, new Options <string>(strictOrdering, comparer)); var secondByValue = new CollectionByValue <string>(secondCollection, new Options <string>(strictOrdering, comparer)); CollectionByValueAssert.AreEqual(firstByValue, secondByValue); }
public void OfEmptySet_ShouldNotBeEqualToOfNullSet() { var firstSet = new HashSet <string> { }; var secondSet = (ISet <string>)null; var firstByValue = new SetByValue <string>(firstSet, Options); var secondByValue = new SetByValue <string>(secondSet, Options); CollectionByValueAssert.AreNotEqual(firstByValue, secondByValue); }
public void OfShuffledItems_ShouldBeEqual() { var firstSet = new HashSet <string> { "1", "2" }; var secondSet = new HashSet <string> { "2", "1" }; var firstByValue = new SetByValue <string>(firstSet, Options); var secondByValue = new SetByValue <string>(secondSet, Options); CollectionByValueAssert.AreEqual(firstByValue, secondByValue); }
public void OfSetsOfDifferentTypes_ShouldNotBeEqual() { var firstSet = new HashSet <byte> { 1, 2 }; var secondSet = new HashSet <int> { 1, 2 }; var firstByValue = new SetByValue <byte>(firstSet, new Options <byte>(true, null)); var secondByValue = new SetByValue <int>(secondSet, new Options <int>(true, null)); CollectionByValueAssert.AreNotEqual(firstByValue, secondByValue); }
public void OfSetsWithDifferentItemsCount_ShouldNotBeEqual() { var firstSet = new HashSet <string> { "1", "2" }; var secondSet = new HashSet <string> { "1" }; var firstByValue = new SetByValue <string>(firstSet, Options); var secondByValue = new SetByValue <string>(secondSet, Options); CollectionByValueAssert.AreNotEqual(firstByValue, secondByValue); }
public void WithCustomComparer_ShouldUseComparer() { var firstSet = new HashSet <string> { "1", "2" }; var secondSet = new HashSet <string> { "1", "222" }; var comparer = new AlwaysEqualsEqualityComparer <string>(); var firstByValue = new SetByValue <string>(firstSet, new Options <string>(false, comparer)); var secondByValue = new SetByValue <string>(secondSet, new Options <string>(false, comparer)); CollectionByValueAssert.AreEqual(firstByValue, secondByValue); }