Skip to content
Permalink
Browse files

DirectoryWatcherBase - SubscribeFileRelativeSubDir

  • Loading branch information
bobbymcr committed Feb 10, 2020
1 parent 8748d28 commit 21e02c60c346a414784664df4adbd24adc632ef5
@@ -239,6 +239,19 @@ public void SubscribeDotFileName()
ae.ParamName.Should().Be("file");
}

[TestMethod]
public void SubscribeFileRelativeSubDir()
{
DirectoryWatcherBase watcherBase = new FakeDirectoryWatcher(new DirectoryInfo(@"X:\root"));
Action<FileInfo> onUpdate = f => { };

Action act = () => watcherBase.Subscribe(@"inner\file1.txt", onUpdate);

ArgumentException ae = act.Should().Throw<ArgumentException>().Which;
ae.Message.Should().Contain(@"Invalid file name 'inner\file1.txt'");
ae.ParamName.Should().Be("file");
}

private sealed class FakeDirectoryWatcher : DirectoryWatcherBase
{
public FakeDirectoryWatcher(DirectoryInfo path)

0 comments on commit 21e02c6

Please sign in to comment.
You can’t perform that action at this time.