Exemple #1
0
        public void AreEqualDictionariesGenericShouldReturnTrueIfEqual()
        {
            var dictionary1 = CreateDummyDictionary();
            var dictionary2 = CreateDummyDictionary();

            bool areEqual = CollectionComparer.AreEqualDictionariesGeneric(
                dictionary1, dictionary2);

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

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

            bool areEqual = CollectionComparer.AreEqualDictionariesGeneric(
                dictionary1, dictionary2);

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

            dictionary1[firstKey] = new object();

            bool areEqual = CollectionComparer.AreEqualDictionariesGeneric(
                dictionary1, dictionary2);

            Assert.IsFalse(areEqual);
        }