public void FileChanged()
{
using (var tester = new OptimisticLockedTextFileTester(true))
{
tester.TextFile.Lines.Add(Line);
using (var streamWriter = File.AppendText(tester.TextFile.FilePath))
{
streamWriter.Write("changed");
}
AssertExtensions.ExpectException(() =>
{
tester.TextFile.Persist();
}, typeof(IOException), string.Format(FileChangedMessageFormat, tester.TextFile.FilePath));
}
}