protected override void Because() { factory = MockRepository.GenerateMock<IProcessFactory>(); factory.Expect(x => x.GetProcess("cmd", "foo", "bar")).Return(new StubProcess()); runner = new CommandLineRunner(factory); runner.RunCommand("cmd", "foo", "bar"); }
protected override void Because() { factory = MockRepository.GenerateMock <IProcessFactory>(); factory.Expect(x => x.GetProcess("cmd", "foo", "bar")).Return(new StubProcess()); runner = new CommandLineRunner(factory); runner.RunCommand("cmd", "foo", "bar"); }
public void Run() { RunData data = new RunData(); ProcessStartInfo info = new ProcessStartInfo(); IProcessOutputReader reader = Stub <IProcessOutputReader>(); using (Ordered()) { fileHelper.Expect(m => m.CreateSettingsFile(data)); fileHelper.Expect(m => m.CreateExecutionFolder(data)); processStartInfoFactory.Expect(m => m.CreateProcessStartInfo(data)).Return(info); fileHelper.Expect(m => m.CreateInputFile(data, info)); processOutputReaderFactory.Expect(m => m.CreateReader(data)).Return(reader); processFactory.Expect(m => m.StartProcessAndWait(info, reader)); fileHelper.Expect(m => m.CreateOutputFile(data)); } VerifyTarget(() => target.Run(data)); }