Ejemplo n.º 1
0
        public void GivenNoResultTimeoutInConfiguration_WhenAskingForValue_ThenItShouldThrow()
        {
            // arrange
            IResultConfiguration resultConfiguration = new ResultConfiguration();

            // act
            Action action = () => resultConfiguration.UniqueResultTimeout();

            // assert
            action.Should().Throw <ConfigurationItemNotFoundException>();
        }
Ejemplo n.º 2
0
        public void GivenResultTimeoutNotParseable_WhenAskingForValue_ThenItShouldThrow()
        {
            // arrange
            Environment.SetEnvironmentVariable(new UniqueResultTimeoutMillisecondsKey(), "Dammit, Bobby!");
            IResultConfiguration resultConfiguration = new ResultConfiguration();

            // act
            Action action = () => resultConfiguration.UniqueResultTimeout();

            // assert
            action.Should().Throw <ConfigurationItemParsingException>();
        }
Ejemplo n.º 3
0
        public void GivenResultTimeout_WhenAskingForValue_ThenItShouldReturnCorrectValue()
        {
            // arrange
            Environment.SetEnvironmentVariable(new UniqueResultTimeoutMillisecondsKey(), "123");
            IResultConfiguration resultConfiguration = new ResultConfiguration();

            // act
            TimeSpan actual = resultConfiguration.UniqueResultTimeout();

            // assert
            actual.TotalMilliseconds.Should().Be(123);
        }