Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/TestableIO.System.IO.Abstractions/FileSystemStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,6 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}

#if FEATURE_ASYNC_FILE
/// <inheritdoc cref="Stream.DisposeAsync()" />
public override async ValueTask DisposeAsync()
{
await _stream.DisposeAsync();
await base.DisposeAsync();
}
#endif

/// <summary>
/// Allows to cast the internal Stream to a FileStream
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,18 @@ public void MockFileStream_Null_ShouldReturnSingletonObject()

Assert.That(result1, Is.SameAs(result2));
}

#if FEATURE_ASYNC_FILE
[Test]
public async Task MockFileStream_DisposeAsync_ShouldNotThrow()
{
var fileSystem = new MockFileSystem();
fileSystem.File.WriteAllText("foo.txt", "");
{
await using var reportStream = fileSystem.File.OpenRead("foo.txt");
}
}
#endif

[Test]
public void MockFileStream_Null_ShouldHaveExpectedProperties()
Expand Down
Loading