The `PolicyDelegateCollectionResult<T>.LastPolicyResult.PolicyResultHandlingErrors` collection should be empty after handling delegate by `PolicyCollection` with a `PolicyResult` handler that has a different type than the delegate return type.
kolan72 opened this issue · comments
This test failed, but it should be green:
[Test]
public void Should_No_PolicyResultHandlingErrors_If_Handler_For_OtherType_Than_PolicyResult_Result()
{
var result = PolicyCollection.Create()
.WithRetry(2)
.WithFallback(() => new List<string>() { "1", "2" })
.AddPolicyResultHandlerForAll<List<string>>(pr => { })
.AddPolicyResultHandlerForAll<int>(pr => { })
.HandleDelegate<List<string>>(() => throw new Exception("Test"));
Assert.AreEqual(0, result.LastPolicyResult.PolicyResultHandlingErrors.Count());
}