Esempio n. 1
0
        public void ScanCanRoundTripAttributedClassInstance(
            XmlAttributedTestEventX @event)
        {
            var actual =
                XmlContentSerializer.Scan(@event.GetType().Assembly);

            var expected =
                Assert.IsAssignableFrom <XmlAttributedTestEventX>(
                    @event.RoundTrip(actual));

            Assert.Equal(expected.Number, @event.Number);
            Assert.Equal(expected.Text, @event.Text);
        }
Esempio n. 2
0
        public void ScanCorrectlySerializesAttributedClassInstance(
            XmlAttributedTestEventX @event)
        {
            var actual =
                XmlContentSerializer.Scan(@event.GetType().Assembly);

            var expected = XDocument.Parse(
                "<test-event-x xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://*****:*****@event.Number + "</number>" +
                "  <text>" + @event.Text + "</text>" +
                "</test-event-x>");

            Assert.Equal(
                expected,
                XDocument.Parse(@event.AsSerializedString(actual)),
                new XNodeEqualityComparer());
        }