public void ShouldBreakExecutionAfterSpecifiedAmountOfTime() { var starter = new Infrastructure.ExecutableProcessStarter("arp"); Func <Task> execute = async() => await starter.Start("-a -v", TimeSpan.FromMilliseconds(1)); execute.Should().ThrowExactly <TimeoutException>(); }
public async Task ShouldCaptureProcessStandardError() { var starter = new Infrastructure.ExecutableProcessStarter("arp"); await starter.Start("-s sdsfsddsf adsdsfsdf", TimeSpan.FromDays(1)); starter.StandardError.Length.Should().BeGreaterThan(0); }
public void ShouldThrowIfExecutableNotFound() { var starter = new Infrastructure.ExecutableProcessStarter("unknown-process-name"); Func <Task <int> > start = () => starter.Start(string.Empty, TimeSpan.FromDays(1)); start.Should().Throw <ProcessStartException>(); }