public void GetDirectory_NotMappedPath_FallsBackToPreviousProvider()
        {
            var previousProviderStub = MockRepository.GenerateStub <VirtualPathProvider>();
            var provider             = new TestableResourceVirtualPathProvider(new[] { new ResourcePathMapping("test", "testResourceFolder") }, _testDirectory);

            provider.SetPrevious(previousProviderStub);

            var expectedDirectory = new ResourceVirtualDirectory("test", new DirectoryInfo(Path.Combine(_testDirectory, "Directory.txt")));

            previousProviderStub.Stub(_ => _.GetDirectory("~/res/UnknownDirectory/testDirectory")).Return(expectedDirectory);

            var actual = (ResourceVirtualDirectory)provider.GetDirectory("~/res/UnknownDirectory/testDirectory");

            Assert.That(actual, Is.SameAs(expectedDirectory));
        }
        public void GetDirectory()
        {
            var provider = new TestableResourceVirtualPathProvider(new[] { new ResourcePathMapping("test", "testResourceFolder") }, _testDirectory);

            provider.SetMakeRelativeVirtualPathOverride((a, b) => "testDirectory");
            provider.SetCombineVirtualPathOverride((a, b) => "~/res/test/");

            var expectedDirectoryPath = Path.Combine(_testDirectory, "testResourceFolder\\testDirectory");

            Directory.CreateDirectory(expectedDirectoryPath);

            var actual = (ResourceVirtualDirectory)provider.GetDirectory("~/res/test/testDirectory");

            Assert.That(actual.PhysicalPath, Is.EqualTo(expectedDirectoryPath));
            Assert.That(actual.Exists);
        }