2024-06-11 13:55:23 -04:00
|
|
|
|
using Bit.Core.Billing.Models;
|
2022-06-28 12:17:14 -04:00
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
2024-06-11 13:55:23 -04:00
|
|
|
|
namespace Bit.Core.Test.Billing.Models;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2022-06-28 12:17:14 -04:00
|
|
|
|
public class BillingInfoTests
|
|
|
|
|
|
{
|
2022-08-29 16:06:55 -04:00
|
|
|
|
[Fact]
|
2022-06-28 12:17:14 -04:00
|
|
|
|
public void BillingInvoice_Amount_ShouldComeFrom_InvoiceTotal()
|
|
|
|
|
|
{
|
|
|
|
|
|
var invoice = new Stripe.Invoice
|
|
|
|
|
|
{
|
|
|
|
|
|
AmountDue = 1000,
|
|
|
|
|
|
Total = 2000,
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2024-06-11 13:55:23 -04:00
|
|
|
|
var billingInvoice = new BillingHistoryInfo.BillingInvoice(invoice);
|
2022-06-28 12:17:14 -04:00
|
|
|
|
|
|
|
|
|
|
// Should have been set from Total
|
|
|
|
|
|
Assert.Equal(20M, billingInvoice.Amount);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|