public void TryParseMinimumWaitTimeSpan_WhenGoodValueIsProvided_ReturnsParsedTrue(string input, int hours)
        {
            var expected = new TimeSpan(hours, 0, 0);

            TimeSpan actual;

            systemUnderTest.TryParseMinimumWaitTimeSpan(input, out actual);

            Assert.That(actual, Is.EqualTo(expected));
        }
Beispiel #2
0
        public void SetFilePayloadDownloadDetails_WhenInvalidMinimumWaitTimeInHours_ReturnsDefault()
        {
            TimeSpan minimumWaitTimeSpan;

            downloadSettingsValidatorServiceMock.TryParseMinimumWaitTimeSpan("MinimumWaitTimeInHours",
                                                                             out minimumWaitTimeSpan).Returns(callInfo => false);

            var filePayload = new FilePayload();

            InvokeSetFilePayloadDownloadDetails(filePayload);

            Assert.That(filePayload.MinimumWaitTimeSpan, Is.EqualTo(MinimumWait.TimeSpan));
            loggingServiceMock.Received()
            .LogVerbose("The minimum wait time configuration was invalid, using the default value.");
        }
 private bool TryParseMinimumWaitTimeSpan(string unsafeMinimumWaitTimeInHours, out TimeSpan minimumWaitTimeSpan)
 {
     return(downloadSettingsValidatorService.TryParseMinimumWaitTimeSpan(unsafeMinimumWaitTimeInHours,
                                                                         out minimumWaitTimeSpan));
 }