public void RedactingDoesNotHappenWhenDisabled()
        {
            var instance = new RedactTestClassForXmlText
            {
                BoolTextProperty = new BoolText {
                    Value = true
                },
                DateTimeTextProperty = new DateTimeText {
                    Value = new DateTime(2222, 2, 22, 22, 22, 22, 222, DateTimeKind.Utc)
                },
                DoubleTextProperty = new DoubleText {
                    Value = 123.45
                },
                EnumTextProperty = new RedactEnumText {
                    Value = RedactEnumForXmlText.Second
                },
                IntTextProperty = new IntText {
                    Value = 12345
                },
                NullableBoolTextProperty = new NullableBoolText {
                    Value = false
                },
                NullableDateTimeTextProperty = new NullableDateTimeText {
                    Value = new DateTime(3333, 3, 30, 3, 33, 33, 333, DateTimeKind.Utc)
                },
                NullableDoubleTextProperty = new NullableDoubleText {
                    Value = 987.65
                },
                NullableEnumTextProperty = new NullableRedactEnumText {
                    Value = RedactEnumForXmlText.Third
                },
                NullableIntTextProperty = new NullableIntText {
                    Value = 98765
                },
                StringTextProperty = new StringText {
                    Value = "abc123"
                }
            };

            var serializer = new XmlSerializer <RedactTestClassForXmlText>(options => options.DisableRedact());

            var xml = serializer.Serialize(instance);

            Assert.That(xml, Contains.Substring("true"));
            Assert.That(xml, Contains.Substring("2222-02-22T22:22:22.2220000Z"));
            Assert.That(xml, Contains.Substring("123.45"));
            Assert.That(xml, Contains.Substring("Second"));
            Assert.That(xml, Contains.Substring("12345"));
            Assert.That(xml, Contains.Substring("false"));
            Assert.That(xml, Contains.Substring("3333-03-30T03:33:33.3330000Z"));
            Assert.That(xml, Contains.Substring("987.65"));
            Assert.That(xml, Contains.Substring("Third"));
            Assert.That(xml, Contains.Substring("98765"));
            Assert.That(xml, Contains.Substring("abc123"));
        }
        public void RedactingDoesNotHappenWhenDisabled()
        {
            var instance = new RedactTestClassForXmlText
            {
                BoolTextProperty = new BoolText { Value = true },
                DateTimeTextProperty = new DateTimeText { Value = new DateTime(2222, 2, 22, 22, 22, 22, 222, DateTimeKind.Utc) },
                DoubleTextProperty = new DoubleText { Value = 123.45 },
                EnumTextProperty = new RedactEnumText { Value = RedactEnumForXmlText.Second },
                IntTextProperty = new IntText { Value = 12345 },
                NullableBoolTextProperty = new NullableBoolText { Value = false },
                NullableDateTimeTextProperty = new NullableDateTimeText { Value = new DateTime(3333, 3, 30, 3, 33, 33, 333, DateTimeKind.Utc) },
                NullableDoubleTextProperty = new NullableDoubleText { Value = 987.65 },
                NullableEnumTextProperty = new NullableRedactEnumText { Value = RedactEnumForXmlText.Third },
                NullableIntTextProperty = new NullableIntText { Value = 98765 },
                StringTextProperty = new StringText { Value = "abc123" }
            };

            var serializer = new XmlSerializer<RedactTestClassForXmlText>(options => options.DisableRedact());

            var xml = serializer.Serialize(instance);

            Assert.That(xml, Contains.Substring("true"));
            Assert.That(xml, Contains.Substring("2222-02-22T22:22:22.2220000Z"));
            Assert.That(xml, Contains.Substring("123.45"));
            Assert.That(xml, Contains.Substring("Second"));
            Assert.That(xml, Contains.Substring("12345"));
            Assert.That(xml, Contains.Substring("false"));
            Assert.That(xml, Contains.Substring("3333-03-30T03:33:33.3330000Z"));
            Assert.That(xml, Contains.Substring("987.65"));
            Assert.That(xml, Contains.Substring("Third"));
            Assert.That(xml, Contains.Substring("98765"));
            Assert.That(xml, Contains.Substring("abc123"));
        }
 public void Setup()
 {
     _serializer = new XmlSerializer <RedactTestClassForXmlText>();
     _testClass  = new RedactTestClassForXmlText();
 }
 public void Setup()
 {
     _serializer = new XmlSerializer<RedactTestClassForXmlText>();
     _testClass = new RedactTestClassForXmlText();
 }