Example #1
0
        public void HaveSameElementsShouldReturnTrueIfEqual()
        {
            var dictionary1 = CreateDummyDictionary();
            var dictionary2 = CreateDummyDictionary();

            bool areEqual = CollectionComparer.HaveSameElements(
                dictionary1.Values, dictionary2.Values);

            Assert.IsTrue(areEqual);
        }
Example #2
0
        public void HaveSameElementsShouldReturnFalseIfContainsMoreElements()
        {
            var dictionary1 = CreateDummyDictionary();
            var dictionary2 = CreateDummyDictionary();

            dictionary2.Add("Foo2", new object());

            bool areEqual = CollectionComparer.HaveSameElements(
                dictionary1.Values, dictionary2.Values);

            Assert.IsFalse(areEqual);
        }
Example #3
0
        public void HaveSameElementsShouldReturnFalseIfValueDifferent()
        {
            var dictionary1 = CreateDummyDictionary();
            var dictionary2 = CreateDummyDictionary();
            var firstKey    = dictionary1.First().Key;

            dictionary1[firstKey] = new object();

            bool areEqual = CollectionComparer.HaveSameElements(
                dictionary1.Values, dictionary2.Values);

            Assert.IsFalse(areEqual);
        }