public BaseFileProviderTests() { _mockFileSystem = new MockFileSystemWrapper(new Dictionary <string, MockFileData> { { DirectoryPath1, new MockDirectoryData() }, { DirectoryPath2, new MockDirectoryData() }, { FilePath1, new MockFileData("Testing is meh") }, { FilePath2, new MockFileData("I hate testing") }, { FilePath3, new MockFileData("Testing sucks") } }); _fileProvider = new BaseFileProvider(_mockFileSystem); }
public IFileInfo GetFileInfo(string subpath) { subpath = subpath.Replace("\\", "/"); if (!subpath.StartsWith(Root)) { return(new NotFoundFileInfo(Path.GetFileName(subpath))); } subpath = subpath.Substring(Root.Length); return(BaseFileProvider.GetFileInfo(subpath)); }
public IDirectoryContents GetDirectoryContents(string subpath) { subpath = subpath.Replace("\\", "/"); if (!subpath.StartsWith(Root)) { return(new NotFoundDirectoryContents()); } subpath = subpath.Substring(Root.Length); return(BaseFileProvider.GetDirectoryContents(subpath)); }
public IExpirationTrigger Watch(string filter) { var newFilter = Path.Combine(Root, filter); return(BaseFileProvider.Watch(newFilter)); }