File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
src/TestableIO.System.IO.Abstractions
tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -223,15 +223,6 @@ protected override void Dispose(bool disposing)
223223 base . Dispose ( disposing ) ;
224224 }
225225
226- #if FEATURE_ASYNC_FILE
227- /// <inheritdoc cref="Stream.DisposeAsync()" />
228- public override async ValueTask DisposeAsync ( )
229- {
230- await _stream . DisposeAsync ( ) ;
231- await base . DisposeAsync ( ) ;
232- }
233- #endif
234-
235226 /// <summary>
236227 /// Allows to cast the internal Stream to a FileStream
237228 /// </summary>
Original file line number Diff line number Diff line change @@ -283,6 +283,18 @@ public void MockFileStream_Null_ShouldReturnSingletonObject()
283283
284284 Assert . That ( result1 , Is . SameAs ( result2 ) ) ;
285285 }
286+
287+ #if FEATURE_ASYNC_FILE
288+ [ Test ]
289+ public async Task MockFileStream_DisposeAsync_ShouldNotThrow ( )
290+ {
291+ var fileSystem = new MockFileSystem ( ) ;
292+ fileSystem . File . WriteAllText ( "foo.txt" , "" ) ;
293+ {
294+ await using var reportStream = fileSystem . File . OpenRead ( "foo.txt" ) ;
295+ }
296+ }
297+ #endif
286298
287299 [ Test ]
288300 public void MockFileStream_Null_ShouldHaveExpectedProperties ( )
You can’t perform that action at this time.
0 commit comments