Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. public class ConfigurableBootstrapperWithCustomConvention : ConfigurableBootstrapper
  2. {
  3. public ConfigurableBootstrapperWithCustomConvention(Action<ConfigurableBootstrapperConfigurator> configuration)
  4. : base(configuration)
  5. {
  6. }
  7.  
  8. protected override void ConfigureConventions(NancyConventions nancyConventions)
  9. {
  10. nancyConventions.ViewLocationConventions.Add((viewName, model, context) =>
  11. string.Concat(context.ModuleName, "/Views/", viewName));
  12. base.ConfigureConventions(nancyConventions);
  13. }
  14. }
  15.  
  16. [Test]
  17. public void when_the_default_page_is_loaded_it_should_show_links_to_submit_form()
  18. {
  19. FakeRootPathProvider.RootPath = "../../../MyApp.Web";
  20.  
  21. var bootstrapper = new ConfigurableBootstrapperWithCustomConvention(with =>
  22. {
  23. with.RootPathProvider(new FakeRootPathProvider());
  24. with.ViewEngine<RazorViewEngine>();
  25. with.Module<HomeModule>();
  26. });
  27.  
  28. var browser = new Browser(bootstrapper);
  29. var response = browser.Get("/");
  30.  
  31. Assert.That(response.Body.AsString(), Is.StringContaining("<a href="SubmitSelf">"));
  32. }
  33.  
  34. System.ArgumentNullException : Value cannot be null.
  35. Parameter name: httpContext
  36. at System.Web.HttpContextWrapper..ctor(HttpContext httpContext)
  37. at System.Web.Optimization.Styles.RenderFormat(String tagFormat, String[] paths)
  38. at RazorOutput.RazorView.Execute()
  39. at Nancy.ViewEngines.Razor.NancyRazorViewBase`1.ExecuteView(String body, IDictionary`2 sectionContents)
  40. at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3<T0,T1,T2>(CallSite site, T0 arg0, T1 arg1, T2 arg2)
  41. at Nancy.ViewEngines.Razor.RazorViewEngine.<>c__DisplayClass27.<RenderView>b__26(Stream stream)
  42. at Nancy.Testing.BrowserResponse.get_Body()
  43. 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