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

Filtering for file type in MockFileSystem.Intercept.Creating() #681

Closed
laurenzschmid opened this issue Dec 3, 2024 · 1 comment · Fixed by #707
Closed

Filtering for file type in MockFileSystem.Intercept.Creating() #681

laurenzschmid opened this issue Dec 3, 2024 · 1 comment · Fixed by #707

Comments

@laurenzschmid
Copy link

I wanted to get notified when a ".csv"-file is created and called the MockFileSystem.Intercept.Creating() method like this:

fileSystem.Intercept.Creating(
FileSystemTypes.File,
_ => throw customException,
"*.csv");

It took me quite some time to realize that "*.csv" is used for the "path" instead of the "searchPattern" parameter and because of that, the interceptionCallback was not called when in the "C:"-directory a ".csv"-file was created.

Is there a way to prevent something like this from happening in the future? Maybe something like combining the "path" and "searchPattern" parameters into one?

@vbreuss
Copy link
Member

vbreuss commented Jan 11, 2025

Thanks for reporting, @laurenzschmid. I implemented a change in #707 that replaces the two distinct filtering options with a single filter that uses a globbing syntax.

As this is a breaking change it will not be released immediately, as I have some other topics, I want to address before the next major release...

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 a pull request may close this issue.

2 participants