You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There's a documentation and API issue with this type. There isn't a way to reproduce this, more that the design should be reviewed.
The XML docs say Wraps the <see cref="FileStream" />, but the wrapped field, _stream, is of type Stream. There's no runtime check to ensure that the stream provided in the constructor is of type FileStream. This is confusing because the docs state one thing, but the implementation doesn't seem to match that.
The path parameter for the constructor is defined as string?, but the constructor will throw an ArgumentNullException if path is null. This is confusing, as annotating a parameter as nullable means that the method can accept a null value. If path cannot be null, then remove the nullable annotation.
The intention of this class is to wrap the FileStream but make it testable. So the interface wraps the FileStream and in the "normal" usage in production the provided stream should be a FileStream.
Only in the testing wrapper, we will replace it with a different stream for testing purposes.
I agree, that the XML documentation is short and could be improved, but the intention of it wrapping a FileStream is in essence correct.
With your second point I agree completely. The path parameter should be string.
Hi, I am a college student looking trying to get more involved with open source and looking for a first-time "bug fix" and figured I could help out with this! I am a little confused with what XML docs you are referring to. Perhaps a link would help. As for the string issue, it should be string as opposed to string? because you want the user to pass data through the constructor. Is there anything I could help with as far as fixing the documentation or code? Let me know!
Activity
vbreuss commentedon Feb 9, 2023
Thanks for the hint @JasonBock.
The intention of this class is to wrap the
FileStreambut make it testable. So the interface wraps theFileStreamand in the "normal" usage in production the provided stream should be aFileStream.Only in the testing wrapper, we will replace it with a different stream for testing purposes.
I agree, that the XML documentation is short and could be improved, but the intention of it wrapping a
FileStreamis in essence correct.With your second point I agree completely. The
pathparameter should bestring.A pull request would be welcome!
ZaffyPuck commentedon Apr 7, 2023
Hi, I am a college student looking trying to get more involved with open source and looking for a first-time "bug fix" and figured I could help out with this! I am a little confused with what XML docs you are referring to. Perhaps a link would help. As for the string issue, it should be
stringas opposed tostring?because you want the user to pass data through the constructor. Is there anything I could help with as far as fixing the documentation or code? Let me know!vbreuss commentedon Apr 10, 2023
@ZaffyPuck : The second point was already fixed in #956!
A link to the file is mentioned in the description.
docs: improve documentation for `FileSystemStream` (#971)
github-actions commentedon Apr 19, 2023
This is addressed in release v19.2.15.