Example #1
0
        public void Equal_TrueOnMatchedDictionaryObjectInstances()
        {
            DictionaryObj dobj1 = new DictionaryObj {
                ObjectDictionary = new Dictionary <int, ClassWithFieldsAndProperties>
                {
                    { 1, new ClassWithFieldsAndProperties()
                      {
                          Foo = "one", Bar = "two"
                      } }, { 2, new ClassWithFieldsAndProperties()
                             {
                                 Foo = "three", Bar = "four"
                             } }
                }
            };
            DictionaryObj dobj2 = new DictionaryObj {
                ObjectDictionary = new Dictionary <int, ClassWithFieldsAndProperties>
                {
                    { 1, new ClassWithFieldsAndProperties()
                      {
                          Foo = "one", Bar = "two"
                      } }, { 2, new ClassWithFieldsAndProperties()
                             {
                                 Foo = "three", Bar = "four"
                             } }
                }
            };

            Assert.True(MemberComparer.Equal(dobj1, dobj2));
        }
        public void Equal_TrueOnMatchedDictionaryObjectInstances()
        {
            DictionaryObj dobj1 = new DictionaryObj { ObjectDictionary = new Dictionary<int, ClassWithFieldsAndProperties>
            { { 1, new ClassWithFieldsAndProperties() { Foo = "one", Bar= "two" } }, { 2, new ClassWithFieldsAndProperties() { Foo = "three", Bar= "four" } } } };
              DictionaryObj dobj2 = new DictionaryObj { ObjectDictionary = new Dictionary<int, ClassWithFieldsAndProperties>
            { { 1, new ClassWithFieldsAndProperties() { Foo = "one", Bar= "two" } }, { 2, new ClassWithFieldsAndProperties() { Foo = "three", Bar= "four" } } } };

              Assert.True(MemberComparer.Equal(dobj1, dobj2));
        }