public void DataOnly() { var bom = new ExtractedBOM { Data = new [] { new object[] { "foo" } } }; Assert.Throws <ApplicationException>(() => bom.ToCSV()); }
public void DifferentNumberOfColumnAndData() { var bom = new ExtractedBOM { Columns = new [] { new Column { Label = "a" }, new Column { Label = "b" } }, Data = new [] { new object[] { "foo" } } }; Assert.Throws <ApplicationException>(() => bom.ToCSV()); }
private static string[] BomToCsvLines(ExtractedBOM bom) { return(bom .ToCSV() .Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)); }
public void EmptyBom() { var bom = new ExtractedBOM(); Assert.Throws <ApplicationException>(() => bom.ToCSV()); }