public MockStartPage CreateStartPage(Action <ApplicationStartPage> action) { var startPage = new MockStartPage() { ExecuteAction = action }; return(startPage); }
public static MockStartPage CreateStartPage(Action<StartPage> pageExecuteAction, string pagePath = "~/_pagestart.cshtml") { var page = new MockStartPage() { VirtualPath = pagePath, ExecuteAction = p => { pageExecuteAction(p); } }; return page; }
public void ExecuteStartPageTest() { AppDomainUtils.RunInSeparateAppDomain(() => { var startPage = new MockStartPage() { ExecuteAction = p => p.AppState["x"] = "y" }; ApplicationStartPage.ExecuteStartPage(new WebPageHttpApplication(), p => { }, path => path == "~/_appstart.vbhtml", p => startPage, new string[] { "cshtml", "vbhtml" }); Assert.AreEqual("y", startPage.ApplicationState["x"]); }); }
public void SetVirtualPathTest() { var page = new MockStartPage(); Assert.Throws <NotSupportedException>( () => { page.VirtualPath = "~/hello.cshtml"; } ); }
public static MockStartPage CreateStartPage(Action <StartPage> pageExecuteAction, string pagePath = "~/_pagestart.cshtml") { var page = new MockStartPage() { VirtualPath = pagePath, ExecuteAction = p => { pageExecuteAction(p); } }; page.VirtualPathFactory = new HashVirtualPathFactory(page); page.DisplayModeProvider = new DisplayModeProvider(); return(page); }
public static MockStartPage CreateStartPage(Action <StartPage> pageExecuteAction, string pagePath = "~/_pagestart.cshtml") { var page = new MockStartPage() { VirtualPath = pagePath, ExecuteAction = p => { pageExecuteAction(p); } }; return(page); }
public void ExecuteStartPageTest() { AppDomainUtils.RunInSeparateAppDomain(() => { var startPage = new MockStartPage() { ExecuteAction = p => p.AppState["x"] = "y" }; var objectFactory = GetMockVirtualPathFactory(startPage); ApplicationStartPage.ExecuteStartPage(new WebPageHttpApplication(), p => { }, objectFactory, new string[] { "cshtml", "vbhtml" }); Assert.Equal("y", startPage.ApplicationState["x"]); }); }
public static MockStartPage CreateStartPage(Action<StartPage> pageExecuteAction, string pagePath = "~/_pagestart.cshtml") { var page = new MockStartPage() { VirtualPath = pagePath, ExecuteAction = p => { pageExecuteAction(p); } }; page.VirtualPathFactory = new HashVirtualPathFactory(page); page.DisplayModeProvider = new DisplayModeProvider(); return page; }
public void GetVirtualPathTest() { var page = new MockStartPage(); Assert.Equal(ApplicationStartPage.StartPageVirtualPath, page.VirtualPath); }
public void ExecuteStartPageTest() { AppDomainUtils.RunInSeparateAppDomain(() => { var startPage = new MockStartPage() { ExecuteAction = p => p.AppState["x"] = "y" }; var objectFactory = GetMockVirtualPathFactory(startPage); ApplicationStartPage.ExecuteStartPage(new WebPageHttpApplication(), p => { }, objectFactory, new string[] { "cshtml" }); Assert.Equal("y", startPage.ApplicationState["x"]); }); }
public void SetVirtualPathTest() { var page = new MockStartPage(); Assert.Throws<NotSupportedException>(() => { page.VirtualPath = "~/hello.cshtml"; }); }
public MockStartPage CreateStartPage(Action<ApplicationStartPage> action) { var startPage = new MockStartPage() { ExecuteAction = action }; return startPage; }