Merge pull request #436 from aspnet/mkArtakMSFT-patch-1
Added using block around a disposable type usage
This commit is contained in:
commit
6eb4da3826
|
|
@ -304,7 +304,8 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
|
||||||
|
|
||||||
private void AssertFileChangeRaisesEvent(string directory, IFileSystemWatcher watcher)
|
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());
|
var expectedPath = Path.Combine(directory, Path.GetRandomFileName());
|
||||||
EventHandler<string> handler = (object _, string f) =>
|
EventHandler<string> handler = (object _, string f) =>
|
||||||
{
|
{
|
||||||
|
|
@ -342,6 +343,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
|
||||||
watcher.OnFileChange -= handler;
|
watcher.OnFileChange -= handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(true)]
|
[InlineData(true)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue