The inner exception:
{"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: "}
The test code:
[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);
}
}
The Module looks like this:
public class YonatanModule : NancyModule
{
public YonatanModule()
{
Get["/mytest"] = o =>
{
return View["home"];
};
}
}
I've tried to add a reference to Nancy.ViewEngines.Razor
, according to this and this.
I'm using Nancy 0.16.1, with Razor (Although I'm trying this first test with a clean html page).
Also, I'm using Azure, but in this case I do not run the emulator or anything.
Solved by marking the view "Copy Always" in "Copy to Output Directory".
Not sure why it works in the web project but not via the Browser
in the test project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With