示例#1
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);
        }
示例#2
0
        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);
        }