public void WritingToFileUpdatesTally() { using (var writer = new TallyKeepingFileStreamWriter(File.Open(fileName, FileMode.Append, FileAccess.Write, FileShare.Read))) { writer.Write("12345"); writer.Flush(); Assert.AreEqual(5L, writer.Tally); } }
public void WritingToFileWithEncodingUpdatesTally() { using (var writer = new TallyKeepingFileStreamWriter(File.Open(fileName, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF32)) { writer.Write("12345"); writer.Flush(); Assert.AreEqual(20L, writer.Tally); // BOM is not part of tally - minimal fidelity loss on new files. } }