public void UpdatePageSplitMode_WasCombined_IndividualPagesHaveOwnIds() { var dom = new XmlDocument(); dom.LoadXml(@"<html ><body><div id='foo'></div><div id='1' class='bloom-page A5Landscape bloom-combinedPage'></div></body></html>"); var layout = new Layout() { ElementDistribution = Layout.ElementDistributionChoices.SplitAcrossPages }; layout.UpdatePageSplitMode(dom); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[@id=1]", 0); }
public void UpdatePageSplitMode_WasCombined_IsNowSplitIntoTwoPages() { var dom = new XmlDocument(); dom.LoadXml(@"<html ><body><div id='somemarginbox'><div class='bloom-page A5Landscape bloom-combinedPage'></div></div></body></html>"); var layout = new Layout() {ElementDistribution = Layout.ElementDistributionChoices.SplitAcrossPages}; layout.UpdatePageSplitMode(dom); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[contains(@class,'bloom-page')]", 2); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[contains(@class,'bloom-combinedPage')]", 0); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[contains(@class,'bloom-leadingPage')]", 1); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[contains(@class,'bloom-trailingPage')]", 1); }
public void UpdatePageSplitMode_WasCombinedAndShouldStayThatWay_PageUntouched() { var dom = new XmlDocument(); dom.LoadXml(@"<html ><body><div id='foo'></div><div class='bloom-page A5Landscape bloom-combinedPage'></div></body></html>"); var layout = new Layout() { ElementDistribution = Layout.ElementDistributionChoices.CombinedPages }; layout.UpdatePageSplitMode(dom); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[contains(@class,'bloom-page')]", 1); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[contains(@class,'bloom-combinedPage')]", 1); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[contains(@class,'bloom-leadingPage')]", 0); AssertThatXmlIn.Dom(dom).HasSpecifiedNumberOfMatchesForXpath("//div[contains(@class,'bloom-trailingPage')]", 0); }