コード例 #1
0
        public void ReadStateInitialBehavior()
        {
            var expected = new XmlDocument().CreateNavigator().ReadSubtree();
            var sut      = EmptyXmlReader.Create();

            ValidateExpectedBehavior(sut, expected);
        }
コード例 #2
0
 public void XmlReaderConformanceOnTransform(XmlElementBuilder builder, string expected)
 {
     AssertTransformConformance(new XmlBuilderReader(builder), expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)));
     AssertTransformConformance(expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)), new XmlBuilderReader(builder));
     AssertTransformResult(new XmlBuilderReader(builder), expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)));
     AssertTransformInvocations(new XmlBuilderReader(builder), expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)));
 }
コード例 #3
0
 public void XmlReaderConformanceOnOuterXml(XmlElementBuilder builder, string expected)
 {
     AssertOuterXmlConformance(new XmlBuilderReader(builder), expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)));
     AssertOuterXmlConformance(expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)), new XmlBuilderReader(builder));
     AssertOuterXmlContent(new XmlBuilderReader(builder), expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)));
     AssertOuterXmlInvocations(new XmlBuilderReader(builder), expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)));
 }
コード例 #4
0
        public void ReadStateEndOfFileBehavior()
        {
            var expected = new XmlDocument().CreateNavigator().ReadSubtree();
            var sut      = EmptyXmlReader.Create();

            Assert.That(sut.Read(), Is.EqualTo(expected.Read()));

            ValidateExpectedBehavior(sut, expected);
        }
コード例 #5
0
        public void Read()
        {
            var expected = new XmlDocument().CreateNavigator().ReadSubtree();
            var sut      = EmptyXmlReader.Create();

            Assert.That(sut.ReadState, Is.EqualTo(expected.ReadState));
            Assert.That(sut.Read(), Is.EqualTo(expected.Read()));
            Assert.That(sut.ReadState, Is.EqualTo(expected.ReadState));
        }
コード例 #6
0
        public void ReadStateEndOfFileBehavior()
        {
            var expected = new XmlDocument().CreateNavigator() !.ReadSubtree();
            var sut      = EmptyXmlReader.Create();

            sut.Read().Should().Be(expected.Read());

            ValidateExpectedBehavior(sut, expected);
        }
コード例 #7
0
        public void Read()
        {
            var expected = new XmlDocument().CreateNavigator() !.ReadSubtree();
            var sut      = EmptyXmlReader.Create();

            sut.ReadState.Should().Be(expected.ReadState);
            sut.Read().Should().Be(expected.Read());
            sut.ReadState.Should().Be(expected.ReadState);
        }
コード例 #8
0
        public void ReadToEnd()
        {
            var expected = new XmlDocument().CreateNavigator().ReadSubtree();
            var sut      = EmptyXmlReader.Create();

            using (expected)
                using (sut)
                {
                    while (expected.Read())
                    {
                    }
                    while (sut.Read())
                    {
                    }
                    ValidateExpectedBehavior(sut, expected);
                }
            ValidateExpectedBehavior(sut, expected);
        }
コード例 #9
0
 public void XmlReaderConformanceOnRead(XmlElementBuilder builder, string expected)
 {
     AssertReadConformance(new XmlBuilderReader(builder), expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)));
     AssertReadConformance(expected.IsNullOrEmpty() ? EmptyXmlReader.Create() : XmlReader.Create(new StringReader(expected)), new XmlBuilderReader(builder));
 }