public async Task CloseFileAsync_Opened() { using var writer = new DiskWriter(); await writer.WriteAsync(TorrentFile, 0, new byte[10].AsMemory()); Assert.IsTrue(File.Exists(TorrentFile.FullPath)); Assert.DoesNotThrowAsync(async() => await writer.CloseAsync(TorrentFile)); File.Delete(TorrentFile.FullPath); }
public void CloseFileAsync_Unopened() { using var writer = new DiskWriter(); Assert.DoesNotThrowAsync(async() => await writer.CloseAsync(TorrentFile)); }