|
|
|
@ -1,5 +1,6 @@ |
|
|
|
using System; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Shouldly; |
|
|
|
using Xunit; |
|
|
|
|
|
|
|
@ -24,10 +25,24 @@ namespace Payment.PaymentRequests |
|
|
|
Price = 99.99m |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
result.Id.ShouldNotBe(Guid.Empty); |
|
|
|
result.Price.ShouldBe(99.99m); |
|
|
|
result.ProductName.ShouldBe("My product 1"); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Should_Create_Payment_Request_With_Default_Currency() |
|
|
|
{ |
|
|
|
var result = await _paymentRequestAppService.CreateAsync(new PaymentRequestCreationDto |
|
|
|
{ |
|
|
|
Price = 4.95m, |
|
|
|
ProductName = "Donation" |
|
|
|
}); |
|
|
|
|
|
|
|
var options = GetRequiredService<IOptions<PaymentOptions>>(); |
|
|
|
|
|
|
|
result.Currency.ShouldBe(options.Value.DefaultCurrency); |
|
|
|
} |
|
|
|
} |
|
|
|
} |