コード例 #1
0
        public void SutCanRoundTripToString(
            XmlContentSerializer serializer,
            XmlAtomContent seed,
            XmlAttributedTestEventX tex)
        {
            var expected = seed.WithItem(tex);
            var xml      = expected.ToXmlString(serializer);

            XmlAtomContent actual = XmlAtomContent.Parse(xml, serializer);

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void ParseThrowsOnWrongContainingElement(
            string startElement,
            string endElement,
            IContentSerializer dummySerializer)
        {
            var xml =
                startElement +
                "  <test-event-x xmlns=\"urn:grean:atom-event-store:unit-tests\">" +
                "    <number>42</number>" +
                "    <text>Foo</text>" +
                "  </test-event-x>" +
                endElement;

            Assert.Throws <ArgumentException>(
                () => XmlAtomContent.Parse(
                    xml,
                    dummySerializer));
        }