public void WhenBlackBoxProgramIsExecuted() { var dropZone = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.DropZone]); var outputZone = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.OutputZone]); var program = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.BlackBoxProgram]); var command = $"\" java -jar \"{program}\" \"{dropZone}\" \"{outputZone}\"\""; var execution = new CommandExecution(); ScenarioContext.Current[ContextKey.Log] = execution.Execute(command, true); }
public void AfterScenario() { if (ScenarioContext.Current.ContainsKey(ContextKey.Driver)) { var driver = (ChromeDriver)ScenarioContext.Current[ContextKey.Driver]; driver.Close(); } CommandExecution execution = new CommandExecution(); var command = "taskkill /im node.exe /F"; var processExecutionResult = execution.Execute(command, false); }
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"); } }
private static void Main() { Console.WriteLine("Choose the operation:"); Console.WriteLine("------------------------"); Console.WriteLine("Creational Patterns"); Console.WriteLine("------------------------"); Console.WriteLine("1 - Abstract Factory"); Console.WriteLine("2 - Factory Method"); Console.WriteLine("3 - Singleton"); Console.WriteLine("------------------------"); Console.WriteLine("Structural Patterns"); Console.WriteLine("------------------------"); Console.WriteLine("4 - Adapter"); Console.WriteLine("5 - Facade"); Console.WriteLine("6 - Composite"); Console.WriteLine("------------------------"); Console.WriteLine("7 - Command"); Console.WriteLine("8 - Strategy"); Console.WriteLine("9 - Observer"); Console.WriteLine("------------------------"); var option = Console.ReadKey(); Console.WriteLine(""); Console.WriteLine("------------------------"); Console.WriteLine(""); switch (option.KeyChar) { case '1': AbstractFactoryExecution.Execute(); break; case '2': FactoryMethodExecution.Execute(); break; case '3': SingletonExecution.Execute(); break; case '4': AdapterExecution.Execute(); break; case '5': FacadeExecution.Execute(); break; case '6': CompositeExecution.Execute(); break; case '7': CommandExecution.Execute(); break; case '8': StrategyExecution.Execute(); break; case '9': ObserverExecution.Execute(); break; } Console.ReadKey(); Console.Clear(); Main(); }
public static void AfterTestRun() { CommandExecution execution = new CommandExecution(); var command = "taskkill /im node.exe /F"; var processExecutionResult = execution.Execute(command, false); }