public void BasicXmatterTest(string source) { SetupFor(source); var starLangCol = _sheet.GetRequiredColumnForLang("*"); var styleNumberSequenceRow = _rows.Find(x => x.MetadataKey.Equals("[styleNumberSequence]")); Assert.That(styleNumberSequenceRow, Is.Not.Null); Assert.That(styleNumberSequenceRow.GetCell(starLangCol).Content, Is.EqualTo("0")); }
public void SpreadsheetIOWriteSpreadsheet_RetainMarkupOptionRetainsMarkup() { using (var tempFile = TempFile.WithExtension("xslx")) { SpreadsheetIO.WriteSpreadsheet(_sheetFromExport, tempFile.Path, retainMarkup: true); var info = new FileInfo(tempFile.Path); using (var package = new ExcelPackage(info)) { var worksheet = package.Workbook.Worksheets[0]; int c = _sheetFromExport.GetRequiredColumnForLang("en"); var rowCount = worksheet.Dimension.Rows; //The first TextGroup row should contain the marked-up string we are looking for for (int r = 0; true; r++) { Assert.That(r, Is.LessThan(rowCount), "did not find expected TextGroup row"); ExcelRange rowTypeCell = worksheet.Cells[r + 1, 1]; if (rowTypeCell.Value.ToString().Equals(InternalSpreadsheet.PageContentRowLabel)) { string markedUp = @"<p><span id=""e4bc05e5-4d65-4016-9bf3-ab44a0df3ea2"" class=""bloom-highlightSegment"" recordingmd5=""undefined"">This elephant is running amok.</span> <span id=""i2ba966b6-4212-4821-9268-04e820e95f50"" class=""bloom-highlightSegment"" recordingmd5=""undefined"">Causing much damage.</span></p>"; ExcelRange textCell = worksheet.Cells[r + 1, c + 1]; Assert.That(textCell.Value.ToString().Contains(markedUp)); break; } } } } }
public void SavesTextFromBlocks(string source) { SetupFor(source); var enCol = _sheet.GetRequiredColumnForLang("en"); var frCol = _sheet.GetRequiredColumnForLang("fr"); var deCol = _sheet.GetRequiredColumnForLang("de"); // The first row has data from the second element in the document, because of tabindex. Assert.That(_pageContentRows[0].GetCell(enCol).Text, Is.EqualTo("This elephant is running amok. Causing much damage.")); Assert.That(_pageContentRows[0].GetCell(frCol).Text, Is.EqualTo("This French elephant is running amok. Causing much damage.")); Assert.That(_pageContentRows[1].GetCell(enCol).Text, Is.EqualTo("Elephants should be handled with much care.")); Assert.That(_pageContentRows[1].GetCell(frCol).Text, Is.EqualTo("French elephants should be handled with special care.")); Assert.That(_pageContentRows[1].GetCell(deCol).Text, Is.EqualTo("German elephants are quite orderly.")); Assert.That(_pageContentRows[2].GetCell(enCol).Text, Is.EqualTo("Riding on elephants can be risky.")); Assert.That(_pageContentRows[2].GetCell(frCol).Text, Is.EqualTo("Riding on French elephants can be more risky.")); Assert.That(_pageContentRows[2].GetCell(deCol).Text, Is.EqualTo("Riding on German elephants can be less risky.")); }