public void Load4() { Utilities.FileFormats.GenericDelimited.GenericDelimited TestObject = new Utilities.FileFormats.GenericDelimited.GenericDelimited("\t"); TestObject.Parse("\"Year\tMake\tModel\tLength\r\n1997\tFord\tE350\t2.34\r\n2000\tMercury\tCougar\t2.38\""); Assert.Equal(1, TestObject.NumberOfRows); Assert.Equal("\"Year\tMake\tModel\tLength\r\n1997\tFord\tE350\t2.34\r\n2000\tMercury\tCougar\t2.38\"\r\n", TestObject.ToString()); }
public void ToDelimitedFile() { List <ExportClass> Temp = new ExportClass[] { new ExportClass { ID = 1, Value = "A" }, new ExportClass { ID = 2, Value = "B" }, new ExportClass { ID = 3, Value = "C" } }.ToList(); Assert.DoesNotThrow(() => Temp.ToDelimitedFile()); Utilities.FileFormats.GenericDelimited.GenericDelimited TestObject = Temp.ToDelimitedFile(); Assert.Equal(4, TestObject.Count); Assert.Equal("\"ID\"\t\"Value\"\r\n\"1\"\t\"A\"\r\n\"2\"\t\"B\"\r\n\"3\"\t\"C\"\r\n", TestObject.ToString()); }
public void Load4() { Utilities.FileFormats.GenericDelimited.GenericDelimited TestObject = new Utilities.FileFormats.GenericDelimited.GenericDelimited("\t"); TestObject.Parse("\"Year\tMake\tModel\tLength\r\n1997\tFord\tE350\t2.34\r\n2000\tMercury\tCougar\t2.38\""); Assert.Equal(1, TestObject.NumberOfRows); Assert.Equal("\"Year\tMake\tModel\tLength\r\n1997\tFord\tE350\t2.34\r\n2000\tMercury\tCougar\t2.38\"\r\n", TestObject.ToString()); }
public void Load() { Utilities.FileFormats.GenericDelimited.GenericDelimited TestObject = new Utilities.FileFormats.GenericDelimited.GenericDelimited("Year\tMake\tModel\tLength\r\n1997\tFord\tE350\t2.34\r\n2000\tMercury\tCougar\t2.38", "\t"); Assert.Equal(3, TestObject.NumberOfRows); Assert.Equal("\"Year\"\t\"Make\"\t\"Model\"\t\"Length\"" + System.Environment.NewLine + "\"1997\"\t\"Ford\"\t\"E350\"\t\"2.34\"" + System.Environment.NewLine + "\"2000\"\t\"Mercury\"\t\"Cougar\"\t\"2.38\"" + System.Environment.NewLine, TestObject.ToString()); }
public void Load() { Utilities.FileFormats.GenericDelimited.GenericDelimited TestObject = new Utilities.FileFormats.GenericDelimited.GenericDelimited("Year\tMake\tModel\tLength\r\n1997\tFord\tE350\t2.34\r\n2000\tMercury\tCougar\t2.38","\t"); Assert.Equal(3, TestObject.NumberOfRows); Assert.Equal("\"Year\"\t\"Make\"\t\"Model\"\t\"Length\"" + System.Environment.NewLine + "\"1997\"\t\"Ford\"\t\"E350\"\t\"2.34\"" + System.Environment.NewLine + "\"2000\"\t\"Mercury\"\t\"Cougar\"\t\"2.38\"" + System.Environment.NewLine, TestObject.ToString()); }