Пример #1
0
        public void WithTimeout_correctly_sets_Timeout_property(TimeSpan timeout)
        {
            var            sut    = new ProcessOptionsBuilder();
            ProcessOptions actual = sut.WithTimeout(timeout).Build();

            actual.Timeout.Should().Be(timeout);
        }
Пример #2
0
        public void WithTimeout_returns_self(TimeSpan timeout)
        {
            var sut = new ProcessOptionsBuilder();
            ProcessOptionsBuilder actual = sut.WithTimeout(timeout);

            actual.Should().BeSameAs(sut);
        }
Пример #3
0
        public void WithTimeout_has_guard_for_timeout_range(
            [Range(301, int.MaxValue)] int seconds)
        {
            var timeout = TimeSpan.FromSeconds(seconds);
            var sut     = new ProcessOptionsBuilder();

            Action action = () => sut.WithTimeout(timeout);

            action.Should().Throw <ArgumentOutOfRangeException>();
        }