Example #1
0
 public ClassA(int pX, int pY, ClassB pClassB)
 {
     x = pX;
     y = pY;
     classB = pClassB;
     classA = this;
 }
Example #2
0
        public void ClassBXml()
        {
            SimplTypesScope.EnableGraphSerialization();

            ClassB test = new ClassB(1, 2);
            ClassA classA = new ClassA(3, 4, test);

            test.ClassA = classA;

            SimplTypesScope tScope = SimplTypesScope.Get("classB", typeof(ClassA), typeof(ClassB));

            TestMethods.TestSimplObject(test, tScope, Format.Xml);

            SimplTypesScope.DisableGraphSerialization();
        }
Example #3
0
        //        [TestMethod]
        public void ClassBJson()
        {
            SimplTypesScope.EnableGraphSerialization();

            ClassA test = new ClassA(1, 2);
            ClassB classB = new ClassB(3, 4, test);

            test.ClassB = classB;

            SimplTypesScope tScope = SimplTypesScope.Get("classA", typeof(ClassA), typeof(ClassB));

            TestMethods.TestSimplObject(test, tScope, Format.Json);

            SimplTypesScope.DisableGraphSerialization();
        }
Example #4
0
 public ClassB(int pA, int pB, ClassA pClassA)
 {
     a = pA;
     b = pB;
     classA = pClassA;
 }
        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");
        }
Example #6
0
 public ClassA(int pX, int pY)
 {
     x = pX;
     y = pY;
     classA = this;
 }