sel*_*ary 5 .net testing exception nancy
内在的例外:
{"Unable to locate view 'home'\r\nCurrently available view engine extensions: cshtml,vbhtml,sshtml,html,htm\r\nLocations inspected: ,,,,,,,,views/Store/home-he- IL,views/Store/home,Store/home-he-IL,Store/home,views/home-he-IL,views/home,home-he-IL,home\r\nRoot path: "}
Run Code Online (Sandbox Code Playgroud)
测试代码:
[TestFixture]
public class Class1
{
[Test]
public void Spike()
{
// Given
var foo = typeof (RazorViewEngine);
var bar = typeof (SuperSimpleViewEngine);
var bootstrapper = new Bootstrapper();
var browser = new Browser(bootstrapper);
// When
var result = browser.Get("/mytest", with =>
{
with.HttpRequest();
});
// Then
Assert.AreEqual(HttpStatusCode.OK, result.StatusCode);
}
}
Run Code Online (Sandbox Code Playgroud)
该模块看起来像这样:
public class YonatanModule : NancyModule
{
public YonatanModule()
{
Get["/mytest"] = o =>
{
return View["home"];
};
}
}
Run Code Online (Sandbox Code Playgroud)
我试图添加一个引用Nancy.ViewEngines.Razor,根据这个和这个.
我正在使用Nancy 0.16.1,使用Razor(虽然我正在尝试使用干净的html页面进行第一次测试).
此外,我正在使用Azure,但在这种情况下,我不运行模拟器或任何东西.