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

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

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

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

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

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

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