コード例 #1
0
        public void SerializeSimpleTestObject()
        {
            GenericXMLSerializer <object> serializer = GenericXMLSerializer.DefaultInstance();
            SimpleDataStructure1          testObject = SimpleDataStructure1.GetRandom();
            string serialized = serializer.Serialize(testObject);
            SimpleDataStructure1 actualObject = serializer.Deserialize <SimpleDataStructure1>(serialized);

            Assert.AreEqual(testObject, actualObject);
        }
コード例 #2
0
        public void SerializeCyclicTestObject3()
        {
            // arrange
            GenericXMLSerializer <object> serializer = GenericXMLSerializer.DefaultInstance();
            object expectedObject = CycleA.GetRandom();

            // act
            string serialized   = serializer.Serialize(expectedObject);
            CycleA actualObject = serializer.Deserialize <CycleA>(serialized);

            // assert
            Assert.IsTrue(Core.Miscellaneous.Utilities.IsValidXML(serialized));
            TestUtilities.AssertEqual(expectedObject, actualObject);
        }