From d99774f8d9d099697a44e2430c17e52cf90441f6 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 22 Feb 2019 22:52:43 +0900 Subject: [PATCH] fix tests --- BTCPayServer.Tests/UnitTest1.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index a7e8d6868..3813769e2 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -2017,14 +2017,23 @@ donation: }, Facade.Merchant); Assert.Equal(1m, invoice3.Price); - // Should not round up because BTC precision is 8 digits + // Should not round up at 8 digit because the 9th is insignificant var invoice4 = user.BitPay.CreateInvoice(new Invoice() { Price = 1.000000019m, Currency = "BTC", FullNotifications = true }, Facade.Merchant); - Assert.Equal(1.000000019m, invoice4.Price); + Assert.Equal(1.00000002m, invoice4.Price); + + // But not if the 9th is insignificant + invoice4 = user.BitPay.CreateInvoice(new Invoice() + { + Price = 0.000000019m, + Currency = "BTC", + FullNotifications = true + }, Facade.Merchant); + Assert.Equal(0.000000019m, invoice4.Price); var invoice = user.BitPay.CreateInvoice(new Invoice() {