public void FileLockedByAnotherProcess()
{
using (var tester = new OptimisticLockedTextFileTester())
{
tester.TextFile.Lines.Add(Line);
using (var streamWriter = File.AppendText(tester.TextFile.FilePath))
{
AssertExtensions.ExpectException(() =>
{
tester.TextFile.Persist();
}, typeof(IOException), string.Format(FileLockedMessageFormat, tester.TextFile.FilePath));
}
}
}