public void GivenNoPollingFrequencyInConfiguration_WhenAskingForValue_ThenItShouldThrow() { // arrange IResultConfiguration resultConfiguration = new ResultConfiguration(); // act Action action = () => resultConfiguration.PollingFrequency(); // assert action.Should().Throw <ConfigurationItemNotFoundException>(); }
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>(); }
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); }