public void op_Create_IEnumerableOfKeyStringDictionaryNull_FileInfo() { using (var temp = new TempDirectory()) { var destination = temp.Info.ToFile("destination"); Assert.Throws <ArgumentNullException>(() => TempCsvFile.Create(null, destination)); } }
public static int Create(IEnumerable <KeyStringDictionary> data, FileInfo destination, DateTime modified) { using (var file = new TempCsvFile(data)) { return(file.Info.Exists ? new DataFileCreation(destination, modified).Create(new CsvDataSheet(file.Info)) : 0); } }
public static int Create(IEnumerable<KeyStringDictionary> data, FileInfo destination, DateTime modified) { using (var file = new TempCsvFile(data)) { return file.Info.Exists ? new DataFileCreation(destination, modified).Create(new CsvDataSheet(file.Info)) : 0; } }
public void op_Create_IEnumerableOfKeyStringDictionary_FileInfoNull() { var data = new List <KeyStringDictionary> { new KeyStringDictionary { { "VALUE", "123" } } }; Assert.Throws <ArgumentNullException>(() => TempCsvFile.Create(data, null)); }
public void op_Create_IEnumerableOfKeyStringDictionaryEmpty_FileInfo() { using (var temp = new TempDirectory()) { var data = new List <KeyStringDictionary>(); var destination = temp.Info.ToFile("destination"); const int expected = 0; var actual = TempCsvFile.Create(data, destination); Assert.Equal(expected, actual); } }
public void op_Create_IEnumerableOfKeyStringDictionary_FileInfo() { using (var temp = new TempDirectory()) { var destination = temp.Info.ToFile("destination"); var data = new List <KeyStringDictionary> { new KeyStringDictionary { { "VALUE", "123" } } }; var count = TempCsvFile.Create(data, destination); Assert.True(temp.Info.ToFile("destination").Exists); Assert.Equal(1, count); Assert.Equal("123", new CsvDataSheet(destination).First()["VALUE"]); } }