diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index 6eee9385c..643af58f9 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -43,17 +43,19 @@ namespace BTCPayServer.Tests entity.TxFee = Money.Coins(0.1m); entity.Rate = 5000; - var cryptoData = entity.GetCryptoData("BTC", null, true); - Assert.NotNull(cryptoData); // Should use legacy data to build itself - Assert.Null(entity.GetCryptoData("BTC", null, false)); - entity.SetCryptoData(new CryptoData() { ParentEntity = entity, Rate = entity.Rate, CryptoCode = "BTC", TxFee = entity.TxFee, FeeRate = new FeeRate(entity.TxFee, 100), DepositAddress = entity.DepositAddress, Network = null }); - Assert.NotNull(entity.GetCryptoData("BTC", null, false)); - Assert.NotNull(entity.GetCryptoData("BTC", null, true)); - - entity.Payments = new System.Collections.Generic.List(); entity.ProductInformation = new ProductInformation() { Price = 5000 }; + // Some check that handling legacy stuff does not break things + var cryptoData = entity.GetCryptoData("BTC", null, true); + cryptoData.Calculate(); + Assert.NotNull(cryptoData); + Assert.Null(entity.GetCryptoData("BTC", null, false)); + entity.SetCryptoData(new CryptoData() { ParentEntity = entity, Rate = entity.Rate, CryptoCode = "BTC", TxFee = entity.TxFee }); + Assert.NotNull(entity.GetCryptoData("BTC", null, false)); + Assert.NotNull(entity.GetCryptoData("BTC", null, true)); + //////////////////// + var accounting = cryptoData.Calculate(); Assert.Equal(Money.Coins(1.1m), accounting.Due); Assert.Equal(Money.Coins(1.1m), accounting.TotalDue);