public void CreateAsyncFileStreamToCreateNewFile() { const string Target = @"newFile"; using (FileUtilities.CreateAsyncFileStream(GetFullPath(Target), FileMode.CreateNew, FileAccess.Write, FileShare.Read | FileShare.Delete)) { XAssert.IsTrue(File.Exists(GetFullPath(Target))); } }
public void CreateAsyncFileStreamToOpenExistingFle() { const string Target = @"existingFile"; File.WriteAllText(GetFullPath(Target), "Definitely useful content"); using (FileUtilities.CreateAsyncFileStream(GetFullPath(Target), FileMode.Open, FileAccess.Write, FileShare.Read | FileShare.Delete)) { XAssert.IsTrue(File.Exists(GetFullPath(Target))); } }