public void Expected_exit_code_should_not_be_checked_if_requested() { var appService = new AppService(A.Fake<IOutput>(), A.Fake<IAppRunFilterRegistration>()); var result = appService.Run("C:\\Windows\\System32\\tasklist.exe", suppressOutput: true, ignoreExitCode: true); Assert.AreEqual(result.ExitCode, 0); }
public void Trying_to_run_not_existing_app_should_raise_a_exception() { var appService = new AppService(A.Fake<IOutput>(), A.Fake<IAppRunFilterRegistration>()); var e = Assert.Catch<CouldNotStartExternalTool>(() => appService.Run("C:\\appThatDosntExist.exe", "args")); Assert.AreEqual("args", e.Arguments); Assert.AreEqual("C:\\appThatDosntExist.exe", e.AppPath); }
public void Expected_exit_code_should_be_checked() { var appService = new AppService(A.Fake<IOutput>(), A.Fake<IAppRunFilterRegistration>()); var e = Assert.Catch<UnexpectedExitCode>(() => appService.Run("C:\\Windows\\System32\\tasklist.exe", suppressOutput: true, expectedExitCode: 1)); Assert.AreEqual(e.ExpectedExitCode, 1); Assert.AreEqual(e.ExitCode, 0); }
public void Trying_to_run_existing_apps_should_work() { var appService = new AppService(A.Fake<IOutput>(), A.Fake<IAppRunFilterRegistration>()); appService.Run("C:\\Windows\\System32\\tasklist.exe", suppressOutput: true); }