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