SuckInDataFromEditedDom() public method

Create or update the data div with all the data-book values in the document
public SuckInDataFromEditedDom ( HtmlDom dom ) : void
dom HtmlDom This is either the whole document, or a page div that we just edited and want to read from.
return void
Esempio n. 1
0
        public void SuckInDataFromEditedDom_NoDataDIvTitleChanged_NewTitleInCache()
        {
            HtmlDom bookDom = new HtmlDom(@"<html ><head></head><body>
                <div class='bloom-page' id='guid2'>
                    <textarea lang='xyz' data-book='bookTitle'>original</textarea>
                </div>
             </body></html>");
               var data = new BookData(bookDom, _collectionSettings, null);
               Assert.AreEqual("original", data.GetVariableOrNull("bookTitle", "xyz"));

               HtmlDom editedPageDom = new HtmlDom(@"<html ><head></head><body>
                <div class='bloom-page' id='guid2'>
                    <textarea lang='xyz' data-book='bookTitle'>changed</textarea>
                </div>
             </body></html>");

               data.SuckInDataFromEditedDom(editedPageDom);

               Assert.AreEqual("changed", data.GetVariableOrNull("bookTitle", "xyz"));
        }