Skip to content
Permalink
Browse files

DirectoryWatcherBase - SubscribeSameFileTwiceDifferentCase

  • Loading branch information
bobbymcr committed Feb 10, 2020
1 parent 8c0f77f commit eab1aead2af06d12b08e59202e79c05e45a95b83
@@ -164,6 +164,19 @@ public void SubscribeSameFileTwice()
.WithMessage(@"A subscription for 'X:\root\file1.txt' already exists.");
}

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

Action act = () => watcherBase.Subscribe("FILE1.txt", onUpdate);

act.Should().Throw<InvalidOperationException>()
.WithMessage(@"A subscription for 'X:\root\FILE1.txt' already exists.");
}

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

0 comments on commit eab1aea

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