Comments (5)
Can we improve the visibility of this breaking change in the changelog for version 18?
@vbreuss I added this to the release notes: https://github.com/TestableIO/System.IO.Abstractions/releases/tag/v18.0.1
from system.io.abstractions.
@cryolithic :
I am afraid, that we don't have any options to resolve your issue.
- We intentionally changed the return type to a custom Stream class due to #779.
- Directly using
FileStream
is not possible, as the class is sealed and directly affects the file system, so we cannot overwrite/replace it's functionality in the test class.
So in order to work with Streams we had to replace them with a custom wrapper - Using an interface as in other factory classes (e.g.
IFileStream
) instead would also not help in your case, asFileStream
does not implement it and we would no longer return aStream
at all...
What do you want to achieve with this test of yours?
from system.io.abstractions.
The method in question acts as a factory (implementation is a bit more complex, but the details shouldn't matter). It accepts a Stream, and creates a StorageProvider to match the specifics of the stream type as we have different behaviour for a FileStream vs say a MemoryStream.
I worked around it in my code, but any libraries that make a similar check will break when using Abstractions.
from system.io.abstractions.
@cryolithic:
Unfortunately I underestimated this impact in #906 and didn't mark it explicitely as breaking change in itself, so the major version got bumped due to the refactoring in general, but this change is not explicitely mentioned in the changelog.
I don't have any idea for a workaround that doesn't involve this breaking change. Do you?
@fgreinacher:
Can we improve the visibility of this breaking change in the changelog for version 18?
from system.io.abstractions.
I'll go ahead close this. Feel free to reopen/comment if anything else can be improved.
from system.io.abstractions.
Related Issues (20)
- Async options for all actions HOT 1
- IFile.Open(Read) cannot be mocked with NSubstitute anymore due to System.IO.Abstractions.FileSystemStream HOT 8
- MockFileSystem: IFile.GetLastWriteTimeUtc may return wrong last write time after calling IFileInfo.Open HOT 2
- BinaryFormatter becomes obsolete -> Remove it with .NET 8.0 HOT 2
- MockPath.GetFullPath does not match windows behavior. HOT 4
- IDirectoryInfoFactory.Wrap loses part of absolute path when used with MockFileSystem HOT 4
- PathVerifier fails on whitespace filename under Linux and .NET Core HOT 1
- Creating new MockFileInfo thinks file exists when it actually does not. HOT 3
- Microsoft Fakes does not generate Fakes namespace for System.IO.Abstractions interfaces HOT 1
- Release build of my application won't run without the mock dll HOT 3
- IsReadOnly is true when file does not exist HOT 5
- `FileSystemStream` Issues HOT 4
- Clearning the `Directory` flag causes a directory to be turned into a regular file HOT 1
- `FlushAsync` doesn't update file contents HOT 3
- MockFileSystem.Directory.CreateDirectory should throw IOException if conflicting file exists HOT 2
- Signature missing in the dll HOT 8
- FileInfoFactory and DirectoryInfoFactory Wrap implementations don't match the interface for nullability HOT 2
- IFileSystemInfo.ResolveLinkTarget throws exception instead of returning null if the path is not a link HOT 3
- Creation of the default "temp" directory in MockFileSystem should have a toggle HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from system.io.abstractions.