From 6ae3d90ad067057dcdbfe9bed74d4895e528c9d8 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 23 Apr 2015 12:18:49 -0700 Subject: [PATCH] Handle changes in FileProviders. --- .../StaticFileContextTest.cs | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index bfb37c3bc2..01badb16c6 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -66,7 +66,7 @@ namespace Microsoft.AspNet.StaticFiles public IDirectoryContents GetDirectoryContents(string subpath) { - return new NotFoundDirectoryContents(); + throw new NotImplementedException(); } public IFileInfo GetFileInfo(string subpath) @@ -77,13 +77,69 @@ namespace Microsoft.AspNet.StaticFiles return result; } - return new NotFoundFileInfo(subpath); + return new NotFoundFileInfo(); } public IExpirationTrigger Watch(string filter) { throw new NotSupportedException(); } + + private class NotFoundFileInfo : IFileInfo + { + public bool Exists + { + get + { + return false; + } + } + + public bool IsDirectory + { + get + { + throw new NotImplementedException(); + } + } + + public DateTimeOffset LastModified + { + get + { + throw new NotImplementedException(); + } + } + + public long Length + { + get + { + throw new NotImplementedException(); + } + } + + public string Name + { + get + { + throw new NotImplementedException(); + } + } + + public string PhysicalPath + { + get + { + throw new NotImplementedException(); + } + } + + public Stream CreateReadStream() + { + throw new NotImplementedException(); + } + } } private sealed class TestFileInfo : IFileInfo