public void PortalContext_RepositoryPathResolve_OffSite() { CleanupTestSite(); CreateTestSite(); try { string pagePath = "/fakesiteforms/Root/System/alma.jpg/"; string expectedRepositoryPath = "/Root/System/alma.jpg"; System.IO.StringWriter simulatedOutput = new System.IO.StringWriter(); SimulatedHttpRequest simulatedWorkerRequest = new SimulatedHttpRequest(@"\", @"C:\Inetpub\wwwroot", pagePath, "", simulatedOutput, "localhost"); HttpContext simulatedHttpContext = new HttpContext(simulatedWorkerRequest); PortalContext portalContext = PortalContext.Create(simulatedHttpContext); Assert.AreEqual(expectedRepositoryPath, portalContext.RepositoryPath); Assert.AreEqual("Forms", portalContext.AuthenticationMode); } finally { CleanupTestSite(); } }
public static SimulatedHttpRequest CreateRequest(string page, string query, TextWriter output = null) { var request = new SimulatedHttpRequest(@"\", @"C:\Inetpub\wwwroot", page, query, output ?? new StringWriter(), "testhost"); return(request); }
public static HttpContext CreateHttpContext(SimulatedHttpRequest request) { return(new System.Web.HttpContext(request)); }