2018-05-03 03:32:42 +09:00
|
|
|
using System.Collections.Generic;
|
2019-03-05 17:29:52 +09:00
|
|
|
using System.Threading;
|
2018-05-03 03:32:42 +09:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
using BTCPayServer.Rating;
|
|
|
|
using BTCPayServer.Services.Rates;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Tests.Mocks
|
|
|
|
{
|
2020-01-13 22:20:45 +09:00
|
|
|
public class MockRateProvider : IRateProvider
|
2018-05-03 03:32:42 +09:00
|
|
|
{
|
2020-01-17 18:11:05 +09:00
|
|
|
public List<PairRate> ExchangeRates { get; set; } = new List<PairRate>();
|
2020-01-10 14:50:39 +01:00
|
|
|
|
2020-01-13 22:20:45 +09:00
|
|
|
public MockRateProvider()
|
2020-01-10 14:50:39 +01:00
|
|
|
{
|
2020-06-28 17:55:27 +09:00
|
|
|
|
2020-01-10 14:50:39 +01:00
|
|
|
}
|
2020-01-17 18:11:05 +09:00
|
|
|
public Task<PairRate[]> GetRatesAsync(CancellationToken cancellationToken)
|
2018-05-03 03:32:42 +09:00
|
|
|
{
|
2020-01-17 18:11:05 +09:00
|
|
|
return Task.FromResult(ExchangeRates.ToArray());
|
2018-05-03 03:32:42 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|