public void BringBookUpToDate_MovesMetaDataToJson()
{
_bookDom = new HtmlDom(
@"<html>
<head>
<meta content='text/html; charset=utf-8' http-equiv='content-type' />
<meta name='bookLineage' content='old rubbish' />
<meta name='bloomBookLineage' content='first,second' />
<meta name='bloomBookId' content='MyId' />
<title>Test Shell</title>
<link rel='stylesheet' href='Basic Book.css' type='text/css' />
<link rel='stylesheet' href='../../previewMode.css' type='text/css' />;
</head>
<body>
<div class='bloom-page'>
<div class='bloom-page' id='guid2'>
<textarea lang='en' data-book='bookTitle'>my nice title</textarea>
</div>
</div>
</body></html>");
var book = CreateBook();
book.BringBookUpToDate(new NullProgress());
AssertThatXmlIn.Dom(book.RawDom).HasSpecifiedNumberOfMatchesForXpath("//meta[@name='bloomBookLineage']", 0);
AssertThatXmlIn.Dom(book.RawDom).HasSpecifiedNumberOfMatchesForXpath("//meta[@name='bookLineage']", 0);
AssertThatXmlIn.Dom(book.RawDom).HasSpecifiedNumberOfMatchesForXpath("//meta[@name='bloomBookId']", 0);
Assert.That(_metadata.Id, Is.EqualTo("MyId"));
Assert.That(_metadata.BookLineage, Is.EqualTo("first,second"));
Assert.That(_metadata.Title, Is.EqualTo("my nice title"));
// Checking the defaults, when not specified in the metadata
Assert.That(_metadata.IsSuitableForMakingShells, Is.False);
Assert.That(_metadata.IsSuitableForVernacularLibrary, Is.True);
_bookDom = new HtmlDom(
@"<html>
<head>
<meta content='text/html; charset=utf-8' http-equiv='content-type' />
<meta name='SuitableForMakingShells' content='yes' />
<meta name='SuitableForMakingVernacularBooks' content='no' />
<meta name='bloomBookId' content='MyId' />
<title>Test Shell</title>
<link rel='stylesheet' href='Basic Book.css' type='text/css' />
<link rel='stylesheet' href='../../previewMode.css' type='text/css' />;
</head>
<body>
<div class='bloom-page'>
<div class='bloom-page' id='guid2'>
<textarea lang='en' data-book='bookTitle'>my nice title</textarea>
</div>
</div>
</body></html>");
book = CreateBook();
book.BringBookUpToDate(new NullProgress());
// BL-2163, we are no longer migrating suitableForMakingShells
Assert.That(_metadata.IsSuitableForMakingShells, Is.False);
Assert.That(_metadata.IsSuitableForVernacularLibrary, Is.False);
}