Skip to content

Commit 3659ae4

Browse files
Simon Zhao (BEYONDSOFT CONSULTING INC)SimonZhao888
authored andcommitted
Update test method to fix testbug
1 parent f0fc999 commit 3659ae4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/dotnet.Tests/GivenExponentialRetry.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ public async Task ItReturnsOnSuccess()
2525
retryCount.Should().Be(1);
2626
}
2727

28-
[Fact(Skip = "https://github.com/dotnet/sdk/issues/47861")]
28+
[Fact]
2929
public async Task ItRetriesOnError()
3030
{
3131
var retryCount = 0;
3232
Func<Task<string>> action = () =>
3333
{
3434
retryCount++;
35-
throw new Exception();
35+
return Task.FromResult<string>(null);
3636
};
37-
await Assert.ThrowsAsync<AggregateException>(async () => await ExponentialRetry.ExecuteWithRetryOnFailure<string>(action, 2, timer: () => ExponentialRetry.Timer(ExponentialRetry.TestingIntervals)));
37+
var res = await ExponentialRetry.ExecuteWithRetryOnFailure<string>(action, 2, timer: () => ExponentialRetry.Timer(ExponentialRetry.TestingIntervals));
3838

39+
res.Should().BeNull();
3940
retryCount.Should().Be(2);
4041
}
4142
}

0 commit comments

Comments
 (0)