コード例 #1
0
 public override void VisitBodyStart(BodyProxy body)
 {
     this.builder.AppendLine("<Body>");
 }
コード例 #2
0
 public override void VisitBodyEnd(BodyProxy body)
 {
     this.builder.AppendLine("</Body>");
 }
コード例 #3
0
        public void AddsParagraphsToBody_WhenStartVisitingFromSection()
        {
            var builder = new DocumentBuilder();
            builder.InsertParagraph();
            Section section = builder.Document.FirstSection;
            var bodyProxy = new BodyProxy();
            var firstParagraph = A.Fake<ParagraphProxy>();
            var secondParagraph = A.Fake<ParagraphProxy>();

            A.CallTo(() => this.proxyFactory.CreateBody()).Returns(bodyProxy);
            A.CallTo(() => this.proxyFactory.CreateParagraph()).ReturnsNextFromSequence(firstParagraph, secondParagraph);

            section.Accept(this.testee);

            bodyProxy.Children.Should().HaveCount(2)
                .And.ContainInOrder(firstParagraph, secondParagraph);
        }
コード例 #4
0
        public void AddsTablesToBody_WhenStartVisitingFromSection()
        {
            Section section = CreateDocumentWithTables(2, 1, 1).FirstSection;
            var bodyProxy = new BodyProxy();
            var firstTableProxy = A.Fake<TableProxy>();
            var secondTableProxy = A.Fake<TableProxy>();

            A.CallTo(() => this.proxyFactory.CreateBody()).Returns(bodyProxy);
            A.CallTo(() => this.proxyFactory.CreateTable()).ReturnsNextFromSequence(firstTableProxy, secondTableProxy);

            section.Accept(this.testee);

            bodyProxy.Children.Should().ContainInOrder(firstTableProxy, secondTableProxy);
        }
コード例 #5
0
 public BodyProxyFacts()
 {
     this.testee = new BodyProxy();
 }