public void ChangingWorkingDirectory()
		{
			var processRunner = new ProcessRunner("cmd.exe", "/c dir");
			processRunner.Start();
			var outputWithDefaultWorkingDirectory = processRunner.Output;
			processRunner.WorkingDirectory = @"C:\";
			processRunner.Start();
			var outputWithDefinedWorkingDirectory = processRunner.Output;
			Assert.AreNotEqual(outputWithDefaultWorkingDirectory, outputWithDefinedWorkingDirectory);
		}
Exemple #2
0
		private void TryLaunchApp(AppInfo app)
		{
			string exeFilePath = Path.Combine(GetAppExtractionDirectory(app), app.Name + ".exe");
			string exeDirectory = PathExtensions.GetAbsolutePath(Path.GetDirectoryName(exeFilePath));
			var processRunner = new ProcessRunner(exeFilePath) { WorkingDirectory = exeDirectory };
			processRunner.Start();
		}
		public void StandardOutputEvent()
		{
			var logger = new MockLogger();
			var processRunner = new ProcessRunner("cmd.exe", "/c dir");
			processRunner.StandardOutputEvent +=
				outputMessage => logger.Write(Logger.MessageType.Info, outputMessage);
			processRunner.Start();
			Assert.IsTrue(
				logger.LastMessage.Contains("Dir(s)") || logger.LastMessage.Contains("Verzeichnis(se)"),
				logger.LastMessage);
		}
Exemple #4
0
 protected override void LaunchApp(AppInfo app)
 {
     try
     {
         string exeFilePath = Path.Combine(GetAppExtractionDirectory(app), app.Name + ".exe");
         string exeDirectory = PathExtensions.GetAbsolutePath(Path.GetDirectoryName(exeFilePath));
         var processRunner = new ProcessRunner(exeFilePath) { WorkingDirectory = exeDirectory };
         processRunner.Start();
     }
     catch (Exception ex)
     {
         Logger.Warning(app.Name + " was closed with error: " + ex);
     }
 }
 private static void TryRunAdbProcess(ProcessRunner adbProcess)
 {
     try
     {
         adbProcess.Start();
     }
     catch (ProcessRunner.ProcessTerminatedWithError)
     {
         Logger.Warning("Output:" + adbProcess.Output);
         Logger.Warning("Error:" + adbProcess.Errors);
         throw;
     }
 }
		private static void TryRunAdbProcess(ProcessRunner adbProcess)
		{
			adbProcess.Start();
		}