コード例 #1
0
        public void WhenNodeServerIsStarted()
        {
            var nodeServer  = ConfigurationManager.AppSettings[InputData.UIServer];
            var command     = $"cd {DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.UIServerFolder])} & node {nodeServer}";
            var execution   = new CommandExecution();
            var portCorrect = int.TryParse(ConfigurationManager.AppSettings[InputData.Port], out int port);
            var host        = ConfigurationManager.AppSettings[InputData.Host];

            if (!ServiceCheck.IsListening(host, port))
            {
                ScenarioContext.Current[ContextKey.Log] = execution.Execute(command, false);
            }
            else
            {
                Assert.Fail("The server is already running");
            }
        }
コード例 #2
0
        public void GivenServerIsRunningOnHostWithPort(string host, int port)
        {
            var isServerUp = ServiceCheck.IsListening(host, port);

            Assert.IsTrue(isServerUp, $"Service on host {host} and port {port} is not running");
        }