public void ShouldReturnCircularReference() { var enricher = new MessageEnricher(); var worksheet = new SpreadsheetWorkbook(); var e = new SpreadsheetException("Circular Reference xxx", new List <string>() { "C1", "C2", "C3" }, "token"); var actual = enricher.EnrichError(worksheet, e); Assert.Equal("Circular Reference in spreadsheet related to formula '" + worksheet.GetFormulaName() + "'. Cells: " + e.Cells, actual.Message); }
public void ShouldReturnMissingFormula() { var enricher = new MessageEnricher(); var worksheet = new SpreadsheetWorkbook(); var e = new SpreadsheetException("Missing Formula", new List <string>() { "C1", "C2", "C3" }, "token"); var actual = enricher.EnrichError(worksheet, e); Assert.Equal($"Invalid expression found in tax formula [{worksheet.GetFormulaName()}]. Check for merged cells near {e.Cells}", actual.Message); }
public void SpreadsheetExceptionShouldReturnNoMatchesFound() { var enricher = new MessageEnricher(); var worksheet = new SpreadsheetWorkbook(); var e = new SpreadsheetException("No matches found", new List <string>() { "C1", "C2", "C3" }, "token"); var actual = enricher.EnrichError(worksheet, e); Assert.Equal("No match found for token [" + e.Token + "] related to formula '" + worksheet.GetFormulaName() + "'.", actual.Message); }