/// <summary> /// Create a web application using the given location and port number. /// </summary> /// <param name="location">The location of the web application</param> /// <param name="portNumber">The port number the web application will be deployed to</param> public WebApplication(ProjectLocation location, int portNumber) { if (location == null) { throw new ArgumentNullException("location", "You must specify a location"); } if (portNumber <= 0) { throw new ArgumentOutOfRangeException("portNumber", portNumber, "portNumber must be greater than zero"); } Location = location; PortNumber = portNumber; }
public void Run(string webProjectFolder, int portNumber) { var webApplication = new WebApplication(ProjectLocation.FromFolder(webProjectFolder), portNumber); try { _webServer = new IisExpressWebServer(webApplication); _webServer.Start(); _webDriver = new ChromeDriver(); _webDriver.Navigate().GoToUrl(_webServer.BaseUrl); } catch (Exception ex) { throw; } AppDomain.CurrentDomain.DomainUnload += CurrentDomainDomainUnload; }