Dispose FileWatcher in tests
This commit is contained in:
parent
208f0f8a58
commit
206b7b9113
|
|
@ -87,8 +87,8 @@ namespace Microsoft.AspNet.Diagnostics
|
|||
// Arrange
|
||||
var rootPath = Directory.GetCurrentDirectory();
|
||||
// PhysicalFileProvider handles only relative paths but we fall back to work with absolute paths too
|
||||
var provider = new PhysicalFileProvider(rootPath);
|
||||
|
||||
using (var provider = new PhysicalFileProvider(rootPath))
|
||||
{
|
||||
// Act
|
||||
var middleware = GetErrorPageMiddleware(provider);
|
||||
var stackFrame = middleware.GetStackFrame("func1", absoluteFilePath, lineNumber: 10);
|
||||
|
|
@ -100,6 +100,7 @@ namespace Microsoft.AspNet.Diagnostics
|
|||
Assert.Equal(GetCodeLines(10, 10), stackFrame.ContextCode);
|
||||
Assert.Equal(GetCodeLines(11, 16), stackFrame.PostContextCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(RelativePathsData))]
|
||||
|
|
@ -107,8 +108,8 @@ namespace Microsoft.AspNet.Diagnostics
|
|||
{
|
||||
// Arrange
|
||||
var rootPath = Directory.GetCurrentDirectory();
|
||||
var provider = new PhysicalFileProvider(rootPath);
|
||||
|
||||
using (var provider = new PhysicalFileProvider(rootPath))
|
||||
{
|
||||
// Act
|
||||
var middleware = GetErrorPageMiddleware(provider);
|
||||
var stackFrame = middleware.GetStackFrame("func1", relativePath, lineNumber: 10);
|
||||
|
|
@ -120,6 +121,7 @@ namespace Microsoft.AspNet.Diagnostics
|
|||
Assert.Equal(GetCodeLines(10, 10), stackFrame.ContextCode);
|
||||
Assert.Equal(GetCodeLines(11, 16), stackFrame.PostContextCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("TestFiles/EmbeddedSourceFile.txt")]
|
||||
|
|
|
|||
Loading…
Reference in New Issue