Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Throw correct exception if opening read-only file for writing #1135

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

WestRyanK
Copy link
Contributor

Mock classes did not match .net's behavior of throwing UnauthorizedAccessException when opening read-only files with FileAccess.Write, making it impossible to test those scenarios.

This commit fixes the mock classes so that the exception will be thrown correctly.

Mock classes did not match .Net's behavior of throwing
UnauthorizedAccessExceptions when opening readonly files with
FileAccess.Write, making it impossible to test those scenarios.

This commit fixes the mock classes so that the exception will
be thrown correctly.
@vbreuss vbreuss changed the title fix: Throw exception if opening read-only file for writing fix: Throw correct exception if opening read-only file for writing Jul 25, 2024
Copy link
Member

@vbreuss vbreuss left a comment

Choose a reason for hiding this comment

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

Thanks, @WestRyanK for reporting and fixing this error.
I just slightly adapted the PR title, otherwise the pull request looks good to me and will be released shortly!

@vbreuss vbreuss merged commit f4afa40 into TestableIO:main Jul 25, 2024
10 checks passed
Copy link

This is addressed in release v21.0.29.

@github-actions github-actions bot added the state: released Issues that are released label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: released Issues that are released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants