public void DirectoryExists_PhysicalDirectoryDoesNotExist() { var provider = new TestableResourceVirtualPathProvider(new[] { new ResourcePathMapping("test", "testResourceFolder") }, _testDirectory); provider.SetMakeRelativeVirtualPathOverride((a, b) => "testDirectory"); provider.SetCombineVirtualPathOverride((a, b) => "~/res/test/"); Assert.That(provider.DirectoryExists("~/res/test/testDirectory"), Is.False); }
public void DirectoryExists_NotMappedDirectory_FallsBackToPreviousProvider() { var previousProviderStub = MockRepository.GenerateStub <VirtualPathProvider>(); var provider = new TestableResourceVirtualPathProvider(new[] { new ResourcePathMapping("test", "testResourceFolder") }, _testDirectory); provider.SetPrevious(previousProviderStub); previousProviderStub.Stub(_ => _.DirectoryExists("~/res/UnknownDirectory/test")).Return(true); Assert.That(provider.DirectoryExists("~/res/UnknownDirectory/test"), Is.True); }
public void DirectoryExists() { var provider = new TestableResourceVirtualPathProvider(new[] { new ResourcePathMapping("test", "testResourceFolder") }, _testDirectory); provider.SetMakeRelativeVirtualPathOverride((a, b) => "subfolder"); provider.SetCombineVirtualPathOverride((a, b) => "~/res/test/"); Directory.CreateDirectory(Path.Combine(_testDirectory, "testResourceFolder\\subfolder")); Assert.That(provider.DirectoryExists("~/res/test/subfolder")); }