public void Setup() { _runner = new ProcessRunnerSpy(); _filesystem = new MockFileSystem(); _filesystem.AddFile("myProgram.exe", new MockFileData(string.Empty)); _executablePath = "myProgram.exe"; _sut = new RunProcessTask(_runner, _filesystem) { ExecutablePath = _executablePath }; }
private static void AssertProcessWasStartedWithExecutable(ProcessRunnerSpy runner, string executablePath) { Assert.IsTrue(runner.WasStarted, "Should have called Start(), but didn't"); Assert.AreEqual(executablePath, runner.ExecutablePath, $"Should have called Start() with {executablePath}, but was {runner.ExecutablePath}"); }