public void ParseBookFileSpiltForech() { var Parser = new ParseBookFileSplitForeach(); var testresult = Parser.countWordsInFile(filepath); Assert.IsNotEmpty(testresult); Assert.True(testresult.Count == 5677); }
public void WriteToFile() { StreamWriter writetext = new StreamWriter("write.txt", false); StringBuilder builder; var Parser = new ParseBookFileSplitForeach(); var testresult = Parser.countWordsInFile(filepath); foreach (var pair in testresult) { builder = new StringBuilder(); builder.Append(pair.Key); builder.Append(","); builder.Append(pair.Value.count); builder.Append(","); builder.Append(pair.Value.isprime); writetext.WriteLine(builder); } writetext.Close(); }