示例#1
0
        public void EnumTypeAttributeSerializesCorrectlyWhenExtraTypesArePassedIn()
        {
            var container = new EnumTypeAttributeContainer
            {
                Value = MyEnum.Value2
            };

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

            var xml = serializer.Serialize(container);

            Assert.That(xml, Contains.Substring("MyEnum.Value2"));
        }
示例#2
0
        public void EnumTypeAttributeSerializesCorrectlyWhenExtraTypesArePassedIn()
        {
            var container = new EnumTypeAttributeContainer
            {
                Value = MyEnum.Value2
            };

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

            var xml = serializer.Serialize(container);

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