AreEqual() public static method

public static AreEqual ( ICollectionByValue first, ICollectionByValue second ) : void
first ICollectionByValue
second ICollectionByValue
return void
コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: SetByValueTests.cs プロジェクト: sm-g/ByValue
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: SetByValueTests.cs プロジェクト: sm-g/ByValue
        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);
        }
コード例 #7
0
ファイル: SetByValueTests.cs プロジェクト: sm-g/ByValue
        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);
        }