Added using block around a disposable type usage

Noticed this when reviewed an already-merged PR
This commit is contained in:
Artak 2018-05-09 09:47:48 -07:00 committed by GitHub
parent 07517187b6
commit ddc478ab87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 30 deletions

View File

@ -304,7 +304,8 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
private void AssertFileChangeRaisesEvent(string directory, IFileSystemWatcher watcher)
{
var semaphoreSlim = new SemaphoreSlim(0);
using (var semaphoreSlim = new SemaphoreSlim(0))
{
var expectedPath = Path.Combine(directory, Path.GetRandomFileName());
EventHandler<string> handler = (object _, string f) =>
{
@ -342,6 +343,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
watcher.OnFileChange -= handler;
}
}
}
[Theory]
[InlineData(true)]