예제 #1
0
        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();
            }
        }
예제 #2
0
파일: TestTools.cs 프로젝트: kimduquan/DMIS
        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);
        }
예제 #3
0
파일: TestTools.cs 프로젝트: kimduquan/DMIS
 public static HttpContext CreateHttpContext(SimulatedHttpRequest request)
 {
     return(new System.Web.HttpContext(request));
 }