Skip to content

Prevent duplicate dispose exception#349

Merged
fgreinacher merged 2 commits intoTestableIO:masterfrom
gitting:master
Sep 6, 2018
Merged

Prevent duplicate dispose exception#349
fgreinacher merged 2 commits intoTestableIO:masterfrom
gitting:master

Conversation

@gitting
Copy link
Copy Markdown
Contributor

@gitting gitting commented Aug 22, 2018

In situations where multiple using's are stacked against a stream and a reader/writer a "Cannot access a closed Stream" exception is thrown which is not present in a default FileSystem. In particular it's
observed in netcore 2.0, so a new test run with dotnet test against original source will expose it.

The fix just keeps track of disposal attempts.

Comment thread System.IO.Abstractions.TestingHelpers.Tests/MockFileStreamTests.cs
Comment thread System.IO.Abstractions.TestingHelpers.Tests/MockFileStreamTests.cs
Comment thread System.IO.Abstractions.TestingHelpers/MockFileStream.cs
Comment thread System.IO.Abstractions.TestingHelpers/MockFileStream.cs Outdated
Copy link
Copy Markdown
Contributor

@fgreinacher fgreinacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fgreinacher fgreinacher merged commit 90f411d into TestableIO:master Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants