public void EquivilantListsAndMapsAreTreatedCorreclty() { var classA = createInstance(); var classB = createInstance(); Assert.IsTrue(ClassDescriptor.GetClassDescriptor(classA.GetType()).AllFieldDescriptors.Count() == 2, "Incorrect number of field descriptors"); Assert.IsFalse(classA == classB, "Should be different instances"); Assert.IsFalse(TestMethods.CompareOriginalObjectToDeserializedObject(classA, classB).Any(), "Class A and B should be the same... their collections are equivilant."); }
public void NonEquivilantListsAndMapsAreTreatedCorreclty() { var baseInstance = createInstance(); var differentListInstance = createInstance(); differentListInstance.list.Add("difference"); var differentMapInstance = createInstance(); differentMapInstance.map.Add("differnce", 13); Assert.IsFalse(baseInstance == differentListInstance, "A, B Should be different instances"); Assert.IsFalse(baseInstance == differentMapInstance, "A and C should be different instances"); Assert.IsFalse(TestMethods.CompareOriginalObjectToDeserializedObject(baseInstance, differentListInstance).Any(), "Class A and B should not be the same... B's list is different."); Assert.IsTrue(TestMethods.CompareOriginalObjectToDeserializedObject(baseInstance, differentMapInstance).Any(), "Class A and C should not be the same... C's dictionary is different."); }
public void DifferentSimplClassesAreConsideredDifferent() { ClassA test = new ClassA(1, 2); ClassB classB = new ClassB(3, 3, test); test.ClassB = classB; ClassA anotherA = new ClassA(1, 2); ClassB anotherB = new ClassB(3, 4, anotherA); anotherA.ClassB = anotherB; Assert.IsFalse(anotherA == test, "Should be different objects, Class A"); Assert.IsFalse(anotherB == classB, "Should be different objects, Class B"); Assert.IsTrue(TestMethods.CompareOriginalObjectToDeserializedObject(classB, anotherB).Any(), "ClassB's in both cases should not be the same"); Assert.IsTrue(TestMethods.CompareOriginalObjectToDeserializedObject(test, anotherA).Any(), "ClassA's should not both be the same"); }