Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ConfigurableBootstrapperWithCustomConvention : ConfigurableBootstrapper
- {
- public ConfigurableBootstrapperWithCustomConvention(Action<ConfigurableBootstrapperConfigurator> configuration)
- : base(configuration)
- {
- }
- protected override void ConfigureConventions(NancyConventions nancyConventions)
- {
- nancyConventions.ViewLocationConventions.Add((viewName, model, context) =>
- string.Concat(context.ModuleName, "/Views/", viewName));
- base.ConfigureConventions(nancyConventions);
- }
- }
- [Test]
- public void when_the_default_page_is_loaded_it_should_show_links_to_submit_form()
- {
- FakeRootPathProvider.RootPath = "../../../MyApp.Web";
- var bootstrapper = new ConfigurableBootstrapperWithCustomConvention(with =>
- {
- with.RootPathProvider(new FakeRootPathProvider());
- with.ViewEngine<RazorViewEngine>();
- with.Module<HomeModule>();
- });
- var browser = new Browser(bootstrapper);
- var response = browser.Get("/");
- Assert.That(response.Body.AsString(), Is.StringContaining("<a href="SubmitSelf">"));
- }
- System.ArgumentNullException : Value cannot be null.
- Parameter name: httpContext
- at System.Web.HttpContextWrapper..ctor(HttpContext httpContext)
- at System.Web.Optimization.Styles.RenderFormat(String tagFormat, String[] paths)
- at RazorOutput.RazorView.Execute()
- at Nancy.ViewEngines.Razor.NancyRazorViewBase`1.ExecuteView(String body, IDictionary`2 sectionContents)
- at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3<T0,T1,T2>(CallSite site, T0 arg0, T1 arg1, T2 arg2)
- at Nancy.ViewEngines.Razor.RazorViewEngine.<>c__DisplayClass27.<RenderView>b__26(Stream stream)
- at Nancy.Testing.BrowserResponse.get_Body()
- at MyApp.Tests.Integration.Web.Home.HomeModuleTests.when_the_default_page_is_loaded_it_should_show_links_to_submit_form() in HomeModuleTests.cs: line 44
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement