public static WriteFile ( string file, string contents ) : void | ||
file | string | |
contents | string | |
return | void |
public void WriteFile_ListOfOneLine_ShouldWriteOneLineFileToPath() { var lines = new List <string> { "1" }; const string path = @"testing\writerTest.csv"; Utilities.WriteFile(path, lines); Assert.IsTrue(File.Exists(path)); Assert.AreEqual(lines.Count, File.ReadLines(path).Count()); }
public void ShouldGetScoredHandlesFromFileInput() { const string category = "Travel"; var path = @"C:\Users\Nishant\Desktop\Dropbox\Ouzero\Tech-moms\"; var files = Directory.GetFiles(path); var scoredHandles = TwitterDataSourcer.ScoreHandlesFromFiles(files, category); Utilities.WriteScoredHandlesFile(path, scoredHandles, category); DatabaseConnector.BatchInsertRecords(scoredHandles); Utilities.WriteMissingHandlesFile(path, category); var scoringTimes = TwitterDataSourcer.ScoringTimes; path = path + "ScoringTimes.txt"; Utilities.WriteFile(path, scoringTimes); }