public void SetUp() { var builderMock = new Mock<ITableOfContentsBuilder>(); builderMock.Setup(x => x.BuildTableOfContents(It.IsAny<HierarchyCollection<Heading>>())) .Returns((ICollection<HierarchyItem<Heading>> headings) => { return _tableOfContentsOutput; }); _tableOfContentsModule = new TableOfContentsPlugin(new TableOfContentsService(new DummyHtmlStripper()), builderMock.Object); }
public void Test_Returns_Index_Of_TOC_Tag() { var input = "<p>Content[toc]</p>"; Assert.AreEqual(10, TableOfContentsPlugin.GetTableOfContentsPosition(ref input)); }
public void Test_Returns_Negative1_If_Input_Does_Not_Contain_TOC_Tag() { var input = "<p>Content</p>"; Assert.AreEqual(-1, TableOfContentsPlugin.GetTableOfContentsPosition(ref input)); }
public void Test_Removes_TOC_Tag_From_Input() { var input = "[toc]"; TableOfContentsPlugin.GetTableOfContentsPosition(ref input); StringAssert.DoesNotContain("[toc]", input); }