Beispiel #1
0
        public void DictionaryNotEqualsTest()
        {
            // setup
            string nameA  = "Timmy";
            var    itemsA = new Dictionary <string, string>
            {
                { "a", "appleA" },
                { "b", "bananaA" }
            };

            string nameB  = "Timmy";
            var    itemsB = new Dictionary <string, string>
            {
                { "aa", "appleB" },
                { "bb", "bananaB" }
            };

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

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

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

            // assert
            Assert.IsFalse(equal);
        }
        public void ObjectAppenderDictionaryEqualsTest()
        {
            // setup
            string nameA  = "Timmy";
            var    itemsA = new Dictionary <string, string>
            {
                { "a", "apple" },
                { "b", "banana" }
            };

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

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

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

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

            // assert
            Assert.IsTrue(equal);
        }