Пример #1
0
        public void EnumTypeElementSerializesCorrectlyWhenExtraTypesArePassedIn()
        {
            var container = new EnumTypeElementContainer
            {
                Value = MyEnum.Value2
            };

            var serializer = new XmlSerializer <EnumTypeElementContainer>(typeof(MyEnum));

            var xml = serializer.Serialize(container);

            Assert.That(xml, Contains.Substring("MyEnum.Value2"));
        }
Пример #2
0
        public void EnumTypeElementSerializesCorrectlyWhenExtraTypesArePassedIn()
        {
            var container = new EnumTypeElementContainer
            {
                Value = MyEnum.Value2
            };

            var serializer = new XmlSerializer<EnumTypeElementContainer>(typeof(MyEnum));

            var xml = serializer.Serialize(container);

            Assert.That(xml, Contains.Substring("MyEnum.Value2"));
        }