コード例 #1
0
ファイル: HostSetup.cs プロジェクト: ilmaz/WarCraft-Tiger
        public static void BeforeTestSuiteRun()
        {
            var serviceHostPath = @"C:\Courses\DDD-Tiger\Session13\WarCraft-Tiger\Code\ServiceHost";

            _host = new IISExpressHost(serviceHostPath, 29210);
            _host.Start();
        }
コード例 #2
0
        public void ThrowExceptionWhenNotFoundWebApplicationPath()
        {
            Action action = () => IISExpressHost.Start("Foo.Bar.Web", 8088);

            action.ShouldThrow <DirectoryNotFoundException>()
            .WithMessage("Could not infer the web application folder path.");
        }
コード例 #3
0
ファイル: HostingHook.cs プロジェクト: tahlil-ahmadi/GodOfWar
        public static void BeforeTestSuiteRun()
        {
            var projectPath = Path.GetFullPath(@"..\..\..\ServiceHost");

            host = new IISExpressHost(projectPath, 20070);
            host.Start();
        }
コード例 #4
0
        private WebTestConfigurationBuilder AddIISExpressHost(string iisPath, string folderPath, int port)
        {
            var host = new IISExpressHost(folderPath, port, iisPath);

            _hooks.Add(new StartableHostHook(host));
            return(this);
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        public void SetUp()
        {
            environmentVariables = new Dictionary <string, string> {
                { "Foo1", "Bar1" }, { "Sample2", "It work's!" }
            };

            IISExpressHost.Start("IISExpressBootstrapper.SampleApp", 8088, environmentVariables);
        }
コード例 #7
0
        public void ThrowExceptionWhenNotFoundIISExpressPath()
        {
            const string iisExpressPath = @"Z:\Foo\Bar\iis.exe";

            Action action = () => IISExpressHost.Start(null, iisExpressPath: iisExpressPath);

            action.ShouldThrow <IISExpressNotFoundException>();
        }
コード例 #8
0
        public static void StartHost()
        {
            var projectPath = ConfigurationManager.AppSettings["SUTPath"];
            var port        = int.Parse(ConfigurationManager.AppSettings["SUTPort"]);

            host = new IISExpressHost(projectPath, port);
            host.Start();
        }
コード例 #9
0
 public void CreateHost()
 {
     _host = new IISExpressHost("../../../Centaur.ExampleWebApp/", 9058)
     {
         StatusCheckPath     = "/status",
         StatusCheckInterval = TimeSpan.FromMilliseconds(100),
         StatusCheckAttempts = 11
     };
 }
コード例 #10
0
        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();
        }
コード例 #11
0
ファイル: StatusCheckTest.cs プロジェクト: hibri/Centaur
 public void CreateHost()
 {
     _host = new IISExpressHost(TestContext.CurrentContext.TestDirectory + "../../../../Centaur.ExampleWebApp/", 9058)
     {
         StatusCheckPath = "/status",
         StatusCheckInterval = TimeSpan.FromMilliseconds(100),
         StatusCheckAttempts = 11
     };
 }
コード例 #12
0
        public void StartingWithInvalidConfigurationShouldWriteMessage()
        {
            string s = null;

            IISExpressHost.Start(new ConfigFileParameters {
                ConfigFile = "", SiteName = "Does not exist"
            },
                                 output: message => { s = message; });

            s.Should().NotBeNullOrEmpty();
        }
コード例 #13
0
        private static HttpClient EnsureIISExpress()
        {
            if (_iisExpress != null)
            {
                return(IISExpressHttpClient);
            }

            _iisExpress = new IISExpressHost("TestHarness.AspNet", IISExpressPort);

            return(IISExpressHttpClient);
        }
コード例 #14
0
ファイル: WebTestBase.cs プロジェクト: AffinityID/uConcur
        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();
        }
コード例 #15
0
ファイル: WebApplication.cs プロジェクト: macashang/trial-99
 public void Start()
 {
     host = IISExpressHost.Start(parameters);
 }
コード例 #16
0
ファイル: ExampleWebAppTest.cs プロジェクト: hibri/Centaur
 public void StartHost()
 {
     _host = new IISExpressHost(TestContext.CurrentContext.TestDirectory + "../../../../Centaur.ExampleWebApp/", 9059);
     _host.Start();
 }
コード例 #17
0
 public void StartHost()
 {
     _host = new IISExpressHost(TestContext.CurrentContext.TestDirectory + "../../../../Centaur.ExampleWebApp/", 9059);
     _host.EnvironmentVariables.Add("PAYLOAD", "injected");
     _host.Start();
 }
コード例 #18
0
 public void StartIIS()
 {
     _host = new IISExpressHost("TestHarness", Port);
 }
コード例 #19
0
 public void SetUp()
 {
     host = new IISExpressHost("IISExpressBootstrapper.SampleWebApp", 8088);
 }
コード例 #20
0
        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);
            });
        }
コード例 #21
0
 public void StartHost()
 {
     _host = new IISExpressHost("../../../Centaur.ExampleWebApp/", 9059);
     _host.Start();
 }