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

feat: Add support for default values on stream creation #860

Conversation

Birnsen
Copy link
Contributor

@Birnsen Birnsen commented Jun 29, 2022

For some tests we need the current Datetime and normal FileAttributes in order for the system under tests to work properly. This PR adds a new property to the MockFileSystem which initializes the MockFileData with the current Datetime and FileAttributes if needed.

@Birnsen Birnsen changed the title Add support for default values on stream creation feat: Add support for default values on stream creation Jun 29, 2022
@Birnsen Birnsen force-pushed the feature/defaultAttributesForStreamCreation branch from 1dc0bad to 305395d Compare June 29, 2022 13:50
@fgreinacher
Copy link
Contributor

Looking at #861 I'm wondering whether we should set the timestamps by default. Did you try that?

@Birnsen
Copy link
Contributor Author

Birnsen commented Jul 1, 2022

I realized that this "solution" is not the best one and look for a better one, where the timestamps are set at the proper locations.

Thanks for your time. This PR can be closed.

xtopaz added a commit to xtopaz/System.IO.Abstractions that referenced this pull request Jul 2, 2022
This fixes setting of the appropriate timestamps in the MockFileData
instances, when accessing them via the MockFileStream.

This contains the implementation intended in TestableIO#860.
@fgreinacher fgreinacher closed this Jul 3, 2022
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