У меня есть следующие настройки
A.CallTo(() => fakeChargeService
.CreateAsync(A<ChargeCreateOptions>._, A<RequestOptions>._, A<CancellationToken>._))
.Throws<StripeException>((se) => stripeException);
, а затем я утверждаю
var msg = await Assert.ThrowsAsync<StripeException>(async () => await mediator.Send(command, CancellationToken.None));
, который в конечном итоге выполняет этот кусок кода
var policyResult = await Policy.Handle<StripeException>(x => x.ShouldRetry())
.WaitAndRetryAsync(new[]
{
TimeSpan.FromSeconds(0.5),
TimeSpan.FromSeconds(1),
TimeSpan.FromSeconds(2),
})
.ExecuteAndCaptureAsync(async () => await this.chargeService.CreateAsync(options, null, cancellationToken));
и здесь я получаю ошибку
Assert.Throws () Ожидаемый сбой: typeof (Stripe.StripeException) Actual: typeof (FakeItEasy.Configuration.FakeConfigurationException): поддельный метод имеет подпись (Stripe.ChargeCreateOptions, Stripe.RequestOptions, System.Threading.CancellationToken), но броски использовались с (Stripe.StripeException).
Я не уверен, что я делаю неправильно.Любая помощь будет оценена