Using FileSytemTypes.DirectoryOrFile or the equivalent FileSytemTypes.Directory | FileSytemTypes.File does not work when using change notifications, for example Notify.OnCreated(). No events will be returned, even if they occur. You need to create two event watches.
I think this is because ChangeDescriptionExtensions.Matches has the test backwards:
|
if (changeDescription.ChangeType != changeType || |
|
!changeDescription.FileSystemType.HasFlag(fileSystemType)) |
|
{ |
|
return false; |
|
} |
I believe it should should be:
if (changeDescription.ChangeType != changeType ||
!fileSystemType.HasFlag(changeDescription.FileSystemType)
{
return false;
}
And actually -- changeType is a flags enum as well; This indicates that there would also be a bug if you specified multiple watcher change types... so it probably should be:
if (!changeType.HasFlag(changeDescription.ChangeType) ||
!fileSystemType.HasFlag(changeDescription.FileSystemType)
{
return false;
}
I don't know if this is the only place that needs fixing.
Using
FileSytemTypes.DirectoryOrFileor the equivalentFileSytemTypes.Directory | FileSytemTypes.Filedoes not work when using change notifications, for exampleNotify.OnCreated(). No events will be returned, even if they occur. You need to create two event watches.I think this is because
ChangeDescriptionExtensions.Matcheshas the test backwards:Testably.Abstractions/Source/Testably.Abstractions.Testing/Helpers/ChangeDescriptionExtensions.cs
Lines 34 to 38 in ced0997
I believe it should should be:
And actually --
changeTypeis a flags enum as well; This indicates that there would also be a bug if you specified multiple watcher change types... so it probably should be:I don't know if this is the only place that needs fixing.