mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 05:54:26 +01:00
Fix tests and potential regression
This commit is contained in:
@@ -32,7 +32,9 @@ namespace BTCPayServer.Rating.Providers
|
|||||||
{
|
{
|
||||||
string[] parts = property.Name.Split('_');
|
string[] parts = property.Name.Split('_');
|
||||||
decimal value = property.Value.Value<decimal>();
|
decimal value = property.Value.Value<decimal>();
|
||||||
pairRates.Add(new PairRate(new CurrencyPair("BTC", parts[1]), new BidAsk(value)));
|
// When API is broken, they return 0 rate
|
||||||
|
if (value != 0m)
|
||||||
|
pairRates.Add(new PairRate(new CurrencyPair("BTC", parts[1]), new BidAsk(value)));
|
||||||
}
|
}
|
||||||
return pairRates.ToArray();
|
return pairRates.ToArray();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace BTCPayServer.Tests
|
|||||||
public async Task CanQueryDirectProviders()
|
public async Task CanQueryDirectProviders()
|
||||||
{
|
{
|
||||||
// TODO: Check once in a while whether or not they are working again
|
// TODO: Check once in a while whether or not they are working again
|
||||||
string[] brokenShitcoinCasinos = { "binance", "coinbasepro" };
|
string[] brokenShitcoinCasinos = { "bitnob", "binance", "coinbasepro" };
|
||||||
var skipped = 0;
|
var skipped = 0;
|
||||||
var factory = FastTests.CreateBTCPayRateFactory();
|
var factory = FastTests.CreateBTCPayRateFactory();
|
||||||
var directlySupported = factory.AvailableRateProviders.Where(s => s.Source == RateSource.Direct)
|
var directlySupported = factory.AvailableRateProviders.Where(s => s.Source == RateSource.Direct)
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers
|
|||||||
var receiptData = new PosReceiptData();
|
var receiptData = new PosReceiptData();
|
||||||
var summary = order.Calculate();
|
var summary = order.Calculate();
|
||||||
|
|
||||||
var isTopup = selectedChoices.FirstOrDefault().Price is null && currentView == PosViewType.Static;
|
var isTopup = selectedChoices?.FirstOrDefault()?.Price is null && currentView == PosViewType.Static;
|
||||||
if (!isTopup)
|
if (!isTopup)
|
||||||
{
|
{
|
||||||
jposData.ItemsTotal = summary.ItemsTotal;
|
jposData.ItemsTotal = summary.ItemsTotal;
|
||||||
|
|||||||
Reference in New Issue
Block a user