public static void BeforeTestSuiteRun() { var serviceHostPath = @"C:\Courses\DDD-Tiger\Session13\WarCraft-Tiger\Code\ServiceHost"; _host = new IISExpressHost(serviceHostPath, 29210); _host.Start(); }
public void ThrowExceptionWhenNotFoundWebApplicationPath() { Action action = () => IISExpressHost.Start("Foo.Bar.Web", 8088); action.ShouldThrow <DirectoryNotFoundException>() .WithMessage("Could not infer the web application folder path."); }
public static void BeforeTestSuiteRun() { var projectPath = Path.GetFullPath(@"..\..\..\ServiceHost"); host = new IISExpressHost(projectPath, 20070); host.Start(); }
private WebTestConfigurationBuilder AddIISExpressHost(string iisPath, string folderPath, int port) { var host = new IISExpressHost(folderPath, port, iisPath); _hooks.Add(new StartableHostHook(host)); return(this); }
public static void BeforeTestSuiteRun() { //TODO: do not hard code this, nooooooooooooooooooo var projectPath = @"C:\Courses\Jame-GodOfWar\Session 15\GodOfWar\Code\ServiceHost"; host = new IISExpressHost(projectPath, 20070); host.Start(); }
public void SetUp() { environmentVariables = new Dictionary <string, string> { { "Foo1", "Bar1" }, { "Sample2", "It work's!" } }; IISExpressHost.Start("IISExpressBootstrapper.SampleApp", 8088, environmentVariables); }
public void ThrowExceptionWhenNotFoundIISExpressPath() { const string iisExpressPath = @"Z:\Foo\Bar\iis.exe"; Action action = () => IISExpressHost.Start(null, iisExpressPath: iisExpressPath); action.ShouldThrow <IISExpressNotFoundException>(); }
public static void StartHost() { var projectPath = ConfigurationManager.AppSettings["SUTPath"]; var port = int.Parse(ConfigurationManager.AppSettings["SUTPort"]); host = new IISExpressHost(projectPath, port); host.Start(); }
public void CreateHost() { _host = new IISExpressHost("../../../Centaur.ExampleWebApp/", 9058) { StatusCheckPath = "/status", StatusCheckInterval = TimeSpan.FromMilliseconds(100), StatusCheckAttempts = 11 }; }
public void StartHost() { _configFilePath = Path.GetFullPath(TestContext.CurrentContext.TestDirectory + "/applicationhost.config"); _webAppPath = Path.GetFullPath(TestContext.CurrentContext.TestDirectory + "../../../../Centaur.ExampleWebApp/"); configurePhysicalPath(_configFilePath, _webAppPath); _host = new IISExpressHost(new IISExpressConfig(_configFilePath)); _host.Start(); }
public void CreateHost() { _host = new IISExpressHost(TestContext.CurrentContext.TestDirectory + "../../../../Centaur.ExampleWebApp/", 9058) { StatusCheckPath = "/status", StatusCheckInterval = TimeSpan.FromMilliseconds(100), StatusCheckAttempts = 11 }; }
public void StartingWithInvalidConfigurationShouldWriteMessage() { string s = null; IISExpressHost.Start(new ConfigFileParameters { ConfigFile = "", SiteName = "Does not exist" }, output: message => { s = message; }); s.Should().NotBeNullOrEmpty(); }
private static HttpClient EnsureIISExpress() { if (_iisExpress != null) { return(IISExpressHttpClient); } _iisExpress = new IISExpressHost("TestHarness.AspNet", IISExpressPort); return(IISExpressHttpClient); }
public virtual void BeforeAllTests() { var assemblyDirectoryPath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath); var path = Path.GetFullPath(Path.Combine( // ReSharper disable once AssignNullToNotNullAttribute assemblyDirectoryPath, "../../../uConcur.Tests.Web.Umbraco-7.4.0" )); if (!Directory.Exists(path)) { throw new FileNotFoundException($"Path '{path}' was not found.", path); } _database = new TestDatabase(Path.Combine(path, "App_Data/Umbraco.sdf")); _database.Recreate(Path.Combine(path, "App_Data/Umbraco.sdf.sql")); _iis = new IISExpressHost(path, Port) /* { LogOutput = true }*/; _iis.Start(); }
public void Start() { host = IISExpressHost.Start(parameters); }
public void StartHost() { _host = new IISExpressHost(TestContext.CurrentContext.TestDirectory + "../../../../Centaur.ExampleWebApp/", 9059); _host.Start(); }
public void StartHost() { _host = new IISExpressHost(TestContext.CurrentContext.TestDirectory + "../../../../Centaur.ExampleWebApp/", 9059); _host.EnvironmentVariables.Add("PAYLOAD", "injected"); _host.Start(); }
public void StartIIS() { _host = new IISExpressHost("TestHarness", Port); }
public void SetUp() { host = new IISExpressHost("IISExpressBootstrapper.SampleWebApp", 8088); }
public static void Configure(CommandLineApplication command) { command.Description = "Hosts the RESTier API."; command.HelpOption("-h|--help"); var project = command.Option("-p|--project", "The name for the RESTier project, default to the project in current directory", CommandOptionType.SingleValue); var download = command.Option("-d|--download", "Download and install the IIS Express automatically if it is not installed", CommandOptionType.NoValue); command.OnExecute(() => { IWebHost webServer = new IISExpressHost(new IISExpressResolver()); string path = webServer.GetDependencyResolver().Detect(); if (download.HasValue()) { ConsoleHelper.WriteLine(ConsoleColor.Green, "Download and install {0}.", webServer.GetDependencyResolver().GetSoftwareName()); if (string.IsNullOrEmpty(path)) { webServer.GetDependencyResolver().Install(); return(-1); } else { Console.WriteLine("{0} has already been installed in {1}", webServer.GetDependencyResolver().GetSoftwareName(), webServer.GetDependencyResolver().GetPath()); return(-1); } } ConsoleHelper.WriteLine(ConsoleColor.Green, "Hosts the RESTier API for {0}", project.Value()); string projectDirectory = ""; if (string.IsNullOrEmpty(project.Value())) { projectDirectory = Directory.GetCurrentDirectory(); } else { if (!File.Exists(project.Value())) { ConsoleHelper.WriteLine(ConsoleColor.Red, "Can't find solution: {0}", project.Value()); ConsoleHelper.WriteLine("Use \"RESTier run -h\" for more information"); return(0); } projectDirectory = Path.GetDirectoryName(project.Value()); } if (string.IsNullOrEmpty(path)) { ConsoleHelper.WriteLine(ConsoleColor.Red, "Can't find a {0} in {1}", webServer.GetDependencyResolver().GetSoftwareName(), webServer.GetDependencyResolver().GetPath()); ConsoleHelper.WriteLine("Use \"RESTier run -d\" to download and install {0} automatically", webServer.GetDependencyResolver().GetSoftwareName()); ConsoleHelper.WriteLine("Or you can download and install {0} through the URL: {1}", webServer.GetDependencyResolver().GetSoftwareName(), webServer.GetDependencyResolver().GetDownloadInstructionsUri()); return(-1); } if (!string.IsNullOrEmpty(projectDirectory)) { webServer.Host(projectDirectory); } else { webServer.Host(Directory.GetCurrentDirectory()); } return(0); }); }
public void StartHost() { _host = new IISExpressHost("../../../Centaur.ExampleWebApp/", 9059); _host.Start(); }