public void ChildCanBeTable()
        {
            var table = new TableProxy();

            this.testee.Add(table);

            this.testee.Children.Should().Contain(table);
        }
 public override void VisitTableStart(TableProxy table)
 {
     this.builder.AppendLine("<Table>");
 }
        public void SetsTableAsRoot_WhenStartVisitingFromTable()
        {
            Table table = CreateDocumentWithTables(1, 1, 1).FirstSection.Body.Tables[0];

            var tableProxy = new TableProxy();

            A.CallTo(() => this.proxyFactory.CreateTable()).Returns(tableProxy);

            table.Accept(this.testee);

            this.testee.Root.Should().Be(tableProxy);
        }
        public void AddsRowsToTable_WhenStartVisitingFromTable()
        {
            Table table = CreateDocumentWithTables(1, 2, 1).FirstSection.Body.Tables[0];

            var tableProxy = new TableProxy();
            var firstRowProxy = A.Fake<RowProxy>();
            var secondRowProxy = A.Fake<RowProxy>();

            A.CallTo(() => this.proxyFactory.CreateTable()).Returns(tableProxy);
            A.CallTo(() => this.proxyFactory.CreateRow()).ReturnsNextFromSequence(firstRowProxy, secondRowProxy);

            table.Accept(this.testee);

            tableProxy.Rows.Should().HaveCount(2)
                .And.ContainInOrder(firstRowProxy, secondRowProxy);
        }
 public TableProxyFacts()
 {
     this.testee = new TableProxy();
 }