Esempio n. 1
0
        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>();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
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>();
        }