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