From 559f5352571a07c1c108f29ab70f557c3afbb53c Mon Sep 17 00:00:00 2001 From: Andrew Camilleri Date: Tue, 15 May 2018 16:18:26 +0200 Subject: [PATCH] add some coverage for bitpay fields --- BTCPayServer.Tests/UnitTest1.cs | 5 +++++ BTCPayServer/Services/Invoices/InvoiceEntity.cs | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index 5aee1d360..8f1f76599 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -913,6 +913,11 @@ namespace BTCPayServer.Tests Assert.Single(invoice.CryptoInfo); Assert.Equal("LTC", invoice.CryptoInfo[0].CryptoCode); + Assert.True(invoice.PaymentCodes.ContainsKey("LTC")); + Assert.True(invoice.SupportedTransactionCurrencies.ContainsKey("LTC")); + Assert.True(invoice.SupportedTransactionCurrencies["LTC"].Enabled); + Assert.True(invoice.PaymentSubtotals.ContainsKey("LTC")); + Assert.True(invoice.PaymentTotals.ContainsKey("LTC")); var cashCow = tester.LTCExplorerNode; var invoiceAddress = BitcoinAddress.Create(invoice.CryptoInfo[0].Address, cashCow.Network); var firstPayment = Money.Coins(0.1m); diff --git a/BTCPayServer/Services/Invoices/InvoiceEntity.cs b/BTCPayServer/Services/Invoices/InvoiceEntity.cs index 7529f2e6a..c2264e275 100644 --- a/BTCPayServer/Services/Invoices/InvoiceEntity.cs +++ b/BTCPayServer/Services/Invoices/InvoiceEntity.cs @@ -425,10 +425,7 @@ namespace BTCPayServer.Services.Invoices dto.ExchangeRates.Add(cryptoCode, exrates); } - - //TODO: Populate dto.AmountPaid - //TODO: Populate dto.MinerFees - //TODO: Populate dto.TransactionCurrency + //dto.AmountPaid dto.MinerFees & dto.TransactionCurrency are not supported by btcpayserver as we have multi currency payment support per invoice Populate(ProductInformation, dto); Populate(BuyerInformation, dto);