public async void DelayResult_TimeSpanSet_ReturnsDelayedResult() { // ARRANGE TimeSpan timespan = TimeSpan.FromSeconds(2); const int ExpectedResult = 100; // ACT var result = await TaskDelayAndRetry.DelayResult(result : ExpectedResult, delay : timespan); // ASSERT Assert.AreEqual(ExpectedResult, result); }
public async void DownloadStringWithRetries_UriSet_ReturnsFetchedUriString() { // ARRANGE // - nothing to arrange // ACT var result = await TaskDelayAndRetry.DownloadStringWithRetries(uri : "http://stephencleary.com/"); // ASSERT Assert.NotNull(result, "result is null."); var index = result.IndexOf( "http://stephencleary.com", 0, result.Length, StringComparison.OrdinalIgnoreCase); Assert.AreNotEqual(-1, index, "index has unexpected value."); }