public void ACsvDefinitionWithACellForANonExistentHeaderIsInvalid() { var objUt = new CsvDefinition(); objUt.Headers.AddItems("Column 1", "Column 2", "TOTAL"); objUt.Rows.AddItems( new CsvRow { new CsvCell("Column 1", 10), new CsvCell("Column 2", 20), new CsvCell("TOTAL", 30) }, new CsvRow { new CsvCell("Column 1", 11), new CsvCell("Column 2", 21), new CsvCell("Column 3", 31) }); Assert.False(objUt.Validate()); }
public void CanValidateACsvDefinition() { var objUt = new CsvDefinition(); objUt.Headers.AddItems("Column 1", "Column 2", "TOTAL"); objUt.Rows.AddItems( new CsvRow { new CsvCell("Column 1", 10), new CsvCell("Column 2", 20), new CsvCell("TOTAL", 30) }, new CsvRow { new CsvCell("Column 1", 11), new CsvCell("Column 2", 21), new CsvCell("TOTAL", 31) }); Assert.True(objUt.Validate()); }