SetMultilingualContentLanguages() 공개 메소드

public SetMultilingualContentLanguages ( string language2Code, string language3Code ) : void
language2Code string
language3Code string
리턴 void
예제 #1
0
 public void SetMultilingualContentLanguages_ThirdContentLangTurnedOff_RemovedFromDataDiv()
 {
     var dom = new HtmlDom(@"<html><head><div id='bloomDataDiv'><div data-book='contentLanguage2'>xyz</div><div data-book='contentLanguage3'>kbt</div></div></head><body></body></html>");
     var data = new BookData(dom,  new CollectionSettings(), null);
     data.SetMultilingualContentLanguages(null,null);
     AssertThatXmlIn.Dom(dom.RawDom).HasSpecifiedNumberOfMatchesForXpath("//div[@id='bloomDataDiv']/div[@data-book='contentLanguage3']", 0);
 }
예제 #2
0
 public void SetMultilingualContentLanguage_ContentLanguageSpecifiedInHtml_ReadsIt()
 {
     var dom = new HtmlDom(@"<html ><head></head><body>
         <div id='bloomDataDiv'>
                 <div data-book='contentLanguage2'>fr</div>
         </div>
         </body></html>");
     var collectionSettings = new CollectionSettings();
     var data = new BookData(dom,   collectionSettings, null);
     data.SetMultilingualContentLanguages("en", "de");
     Assert.AreEqual("en", data.MultilingualContentLanguage2);
     Assert.AreEqual("de", data.MultilingualContentLanguage3);
 }
예제 #3
0
 public void SetMultilingualContentLanguages_HasTrilingualLanguages_AddsToDataDiv()
 {
     var dom = new HtmlDom(@"<html><head></head><body></body></html>");
     var data = new BookData(dom,  new CollectionSettings(), null);
     data.SetMultilingualContentLanguages("okm", "kbt");
     AssertThatXmlIn.Dom(dom.RawDom).HasSpecifiedNumberOfMatchesForXpath("//div[@id='bloomDataDiv']/div[@data-book='contentLanguage2' and text()='okm']", 1);
     AssertThatXmlIn.Dom(dom.RawDom).HasSpecifiedNumberOfMatchesForXpath("//div[@id='bloomDataDiv']/div[@data-book='contentLanguage3' and text()='kbt']", 1);
 }