Created
March 18, 2011 13:24
-
-
Save emiaj/876057 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SubViewFolderTester | |
{ | |
[Test] | |
public void create_subviewfolder() | |
{ | |
var settings = new SparkSettings(); | |
var folderSettings = new Dictionary<string, string> | |
{ | |
{"virtualBaseDir", "~/Masters"}, | |
{"subfolder", "layouts"} | |
}; | |
settings.AddViewFolder(ViewFolderType.VirtualPathProvider, folderSettings); | |
var factory = new SparkViewFactory(settings); | |
var viewFolder =(CombinedViewFolder) factory.ViewFolder; | |
Assert.IsInstanceOf(typeof(FileSystemViewFolder), viewFolder.First); // Pass | |
Assert.IsInstanceOf(typeof(SubViewFolder), viewFolder.Second); // Fails, is of VirtualPathProviderViewFolder type | |
} | |
[Test] | |
public void create_subviewfolder_using_hack() | |
{ | |
var settings = new SparkSettings(); | |
var folderSettings = new Dictionary<string, string> | |
{ | |
{"virtualBaseDir", "~/Masters"}, | |
}; | |
settings.AddViewFolder(ViewFolderType.VirtualPathProvider, folderSettings); | |
settings.ViewFolders.Last().Subfolder = "layouts"; | |
var factory = new SparkViewFactory(settings); | |
var viewFolder = (CombinedViewFolder)factory.ViewFolder; | |
Assert.IsInstanceOf(typeof(FileSystemViewFolder), viewFolder.First); // Pass | |
Assert.IsInstanceOf(typeof(SubViewFolder), viewFolder.Second); // Pass | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've run the tests against the spark.web.mvc version and got the same results.