From 067dbad54690fb411f87c367418d9b8dc8c81cb5 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 5 Mar 2019 17:29:52 +0900 Subject: [PATCH] Fix build --- BTCPayServer.Tests/ChangellyTests.cs | 2 +- BTCPayServer.Tests/CrowdfundTests.cs | 12 ++++++------ BTCPayServer.Tests/Mocks/MockRateProvider.cs | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/BTCPayServer.Tests/ChangellyTests.cs b/BTCPayServer.Tests/ChangellyTests.cs index c445957fc..94fbe6bed 100644 --- a/BTCPayServer.Tests/ChangellyTests.cs +++ b/BTCPayServer.Tests/ChangellyTests.cs @@ -218,7 +218,7 @@ namespace BTCPayServer.Tests tester.NetworkProvider, fetcher); changellyController.IsTest = true; Assert.IsType(Assert - .IsType(await changellyController.CalculateAmount(user.StoreId, "ltc", "btc", 1.0m)) + .IsType(await changellyController.CalculateAmount(user.StoreId, "ltc", "btc", 1.0m, default)) .Value); } } diff --git a/BTCPayServer.Tests/CrowdfundTests.cs b/BTCPayServer.Tests/CrowdfundTests.cs index a0f4272be..761fb5c2f 100644 --- a/BTCPayServer.Tests/CrowdfundTests.cs +++ b/BTCPayServer.Tests/CrowdfundTests.cs @@ -109,7 +109,7 @@ namespace BTCPayServer.Tests Assert.IsType(await anonAppPubsController.ContributeToCrowdfund(appId, new ContributeToCrowdfund() { Amount = new decimal(0.01) - })); + }, default)); Assert.IsType(await anonAppPubsController.ViewCrowdfund(appId, string.Empty)); @@ -118,7 +118,7 @@ namespace BTCPayServer.Tests { RedirectToCheckout = false, Amount = new decimal(0.01) - })); + }, default)); Assert.IsType(await publicApps.ViewCrowdfund(appId, string.Empty)); Assert.IsType(await anonAppPubsController.ViewCrowdfund(appId, string.Empty)); @@ -130,7 +130,7 @@ namespace BTCPayServer.Tests Assert.IsType(await anonAppPubsController.ContributeToCrowdfund(appId, new ContributeToCrowdfund() { Amount = new decimal(0.01) - })); + }, default)); //Scenario 4: Enabled But End Date < Now - Not Allowed @@ -142,7 +142,7 @@ namespace BTCPayServer.Tests Assert.IsType(await anonAppPubsController.ContributeToCrowdfund(appId, new ContributeToCrowdfund() { Amount = new decimal(0.01) - })); + }, default)); //Scenario 5: Enabled and within correct timeframe, however target is enforced and Amount is Over - Not Allowed @@ -156,13 +156,13 @@ namespace BTCPayServer.Tests Assert.IsType(await anonAppPubsController.ContributeToCrowdfund(appId, new ContributeToCrowdfund() { Amount = new decimal(1.01) - })); + }, default)); //Scenario 6: Allowed Assert.IsType(await anonAppPubsController.ContributeToCrowdfund(appId, new ContributeToCrowdfund() { Amount = new decimal(0.05) - })); + }, default)); } } diff --git a/BTCPayServer.Tests/Mocks/MockRateProvider.cs b/BTCPayServer.Tests/Mocks/MockRateProvider.cs index bd151c8ad..339762992 100644 --- a/BTCPayServer.Tests/Mocks/MockRateProvider.cs +++ b/BTCPayServer.Tests/Mocks/MockRateProvider.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using System.Threading; using System.Threading.Tasks; using BTCPayServer.Rating; using BTCPayServer.Services.Rates; @@ -10,7 +11,7 @@ namespace BTCPayServer.Tests.Mocks public class MockRateProvider : IRateProvider { public ExchangeRates ExchangeRates { get; set; } = new ExchangeRates(); - public Task GetRatesAsync() + public Task GetRatesAsync(CancellationToken cancellationToken) { return Task.FromResult(ExchangeRates); }