public TestWebApplication(string name, string physicalPath, TestWebSite siteContext, string url = null) { _testSite = siteContext; _name = name; string temp = physicalPath; if (physicalPath.Contains("%")) { temp = System.Environment.ExpandEnvironmentVariables(physicalPath); } _physicalPath = temp; if (url != null) { _url = url; } else { string tempUrl = name.Trim(); if (tempUrl[0] != '/') { _url = "/" + tempUrl; } else { _url = tempUrl; } } BackupFile("web.config"); }
public static string GetHttpUri(string Url, TestWebSite siteContext) { string tempUrl = Url.TrimStart(new char[] { '/' }); return("http://" + siteContext.HostName + ":" + siteContext.TcpPort + "/" + tempUrl); }