예제 #1
0
        public void DictionaryNotEqualsWithArraysTest()
        {
            // setup
            string nameA  = "Timmy";
            var    itemsA = new Dictionary <string, object>
            {
                { "a", "apple" },
                { "b", new int[] { 907 } }
            };

            string nameB  = "Timmy";
            var    itemsB = new Dictionary <string, object>
            {
                { "a", "apple" },
                { "b", new int[] { 909 } }
            };

            var dictionaryContainerA = new ObjectDictionaryContainer
            {
                Name  = nameA,
                Items = itemsA
            };

            var dictionaryContainerB = new ObjectDictionaryContainer
            {
                Name  = nameB,
                Items = itemsB
            };

            // test
            var equal = dictionaryContainerA.Equals(dictionaryContainerB);

            // assert
            Assert.IsFalse(equal);
        }
예제 #2
0
        public void DictionaryEqualsWithDeferencingTest()
        {
            // setup
            string nameA  = "Timmy";
            var    itemsA = new Dictionary <string, object>
            {
                { "a", "apple" },
                { "b", 32 }
            };

            string nameB  = "Timmy";
            var    itemsB = new Dictionary <string, object>
            {
                { "a", "apple" },
                { "b", 32 }
            };

            var dictionaryContainerA = new ObjectDictionaryContainer
            {
                Name  = nameA,
                Items = itemsA
            };

            var dictionaryContainerB = new ObjectDictionaryContainer
            {
                Name  = nameB,
                Items = itemsB
            };

            // test
            var equal = dictionaryContainerA.Equals(dictionaryContainerB);

            // assert
            Assert.IsTrue(equal);
        }