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
{{ message }}
Repository navigation
FileSystemWatcher has no setter in MockFileSystem #1329
In #409 a setter was added to MockFileSystem.FileSystemWatcher. The current version of MockFileSystem does not have a setter for FileSystemWatcher. Is this done intentionally, or is it a regression?
In case the property should not have a setter, how should tests be written for classes that get IFileSystem injected and use it to create a file watcher?
Activity
vbreuss commentedon Aug 19, 2025
The setter was removed in #782 and it seems on purpose:
So you would have to create a custom
MyMockFileSystemthat inherits fromMockFileSystemand overrides theFileSystemWatcher.Alternatively you could also try to use
Testably.Abstractions, which has a fully working mockedFileSystemWatcher.Dave-Senn commentedon Sep 3, 2025
@vbreuss Thanks for your answer. For me everything is clear and the question/issue can be closed.