public void ReadStateInitialBehavior() { var expected = new XmlDocument().CreateNavigator().ReadSubtree(); var sut = EmptyXmlReader.Create(); ValidateExpectedBehavior(sut, expected); }
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))); }
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))); }
public void ReadStateEndOfFileBehavior() { var expected = new XmlDocument().CreateNavigator().ReadSubtree(); var sut = EmptyXmlReader.Create(); Assert.That(sut.Read(), Is.EqualTo(expected.Read())); ValidateExpectedBehavior(sut, expected); }
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)); }
public void ReadStateEndOfFileBehavior() { var expected = new XmlDocument().CreateNavigator() !.ReadSubtree(); var sut = EmptyXmlReader.Create(); sut.Read().Should().Be(expected.Read()); ValidateExpectedBehavior(sut, expected); }
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); }
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); }
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)); }