Catel.Test.Runtime.Serialization.XmlSerializerFacts.AdvancedSerializationFacts.CorrectlySerializesObjectsImplementingICustomXmlSerializable_Simple C# (CSharp) Метод

CorrectlySerializesObjectsImplementingICustomXmlSerializable_Simple() приватный Метод

private CorrectlySerializesObjectsImplementingICustomXmlSerializable_Simple ( ) : void
Результат void
            public void CorrectlySerializesObjectsImplementingICustomXmlSerializable_Simple()
            {
                var serviceLocator = ServiceLocator.Default;
                var serializer = serviceLocator.ResolveType<IXmlSerializer>();

                var model = new CustomXmlSerializationModel
                {
                    FirstName = "Geert"
                };

                var clonedModel = SerializationTestHelper.SerializeAndDeserialize(model, serializer, null);

                // Note: yes, the *model* is serialized, the *clonedModel* is deserialized
                Assert.IsTrue(model.IsCustomSerialized);
                Assert.IsTrue(clonedModel.IsCustomDeserialized);

                Assert.AreEqual(model.FirstName, clonedModel.FirstName);
            }