FileSystemWatcherMock

January 30, 2026 ยท View on GitHub

This document explains the implementation of the FileSystemWatcherMock class.

Events

Before we can go into the different events the operating systems fire, we first have to define the locations the entry can be moved from and to.

LocationDescription
_Entry was created or deleted
OutsideThe location is outside the watching path
InsideThe location is immediately inside the watching path
NestedThe location is nested under the watching path
DeepThe location is deeply nested inside the watching path

For IncludeSubdirectories = false we have the following event table:

From -> ToLinuxWindowsMac
_ -> InsideCreatedCreatedCreated
Inside -> _DeletedDeletedDeleted
_ -> Nested---
Nested -> _---
_ -> Deep---
Deep -> _---
Outside -> InsideCreatedCreatedCreated
Inside -> InsideRenamedRenamedRenamed
Inside -> OutsideDeletedDeletedDeleted
Outside -> Nested---
Nested -> Nested---
Nested -> Outside---
Outside -> Deep---
Deep -> Deep---
Deep -> Outside---
Inside -> NestedDeletedDeletedRenamed
Inside -> DeepDeletedDeletedRenamed
Nested -> InsideCreatedCreatedCreated
Deep -> InsideCreatedCreatedCreated
Nested -> Deep---
Deep -> Nested---

For IncludeSubdirectories = true we have the following event table:

From -> ToLinuxWindowsMac
_ -> InsideCreatedCreatedCreated
Inside -> _DeletedDeletedDeleted
_ -> NestedCreatedCreatedCreated
Nested -> _DeletedDeletedDeleted
_ -> DeepCreatedCreatedCreated
Deep -> _DeletedDeletedDeleted
Outside -> InsideCreatedCreatedCreated
Inside -> InsideRenamedRenamedRenamed
Inside -> OutsideDeletedDeletedDeleted
Outside -> NestedCreatedCreatedCreated
Nested -> NestedRenamedRenamedRenamed
Nested -> OutsideDeletedDeletedDeleted
Outside -> DeepCreatedCreatedCreated
Deep -> DeepRenamedRenamedRenamed
Deep -> OutsideDeletedDeletedDeleted
Inside -> NestedRenamedDeleted + CreatedRenamed
Inside -> DeepRenamedDeleted + CreatedRenamed
Nested -> InsideRenamedDeleted + CreatedRenamed
Deep -> InsideRenamedDeleted + CreatedRenamed
Nested -> DeepRenamedDeleted + CreatedRenamed
Deep -> NestedRenamedDeleted + CreatedRenamed