Exemple #1
0
        public void GetExchangeRangeTest(string fromCurrency, string toCurrency, FlowEnum flow, string fromNetwork, string toNetwork)
        {
            var request = new ExchangeRangeRequest(fromCurrency, toCurrency, flow, fromNetwork, toNetwork);

            var result = _client.GetExchangeRange(request);

            Assert.NotNull(result);
            Assert.NotNull(result.FromCurrency);
            Assert.NotNull(result.FromNetwork);
            Assert.NotNull(result.ToCurrency);
            Assert.NotNull(result.ToNetwork);
            Assert.NotNull(result.Flow);
            Assert.NotNull(result.MinAmount);
        }
        public void ExchangeRangeRequestConstruktor()
        {
            var obj = new ExchangeRangeRequest("btc", "eth", FlowEnum.FixedRate, "btc", "eth");

            Assert.AreEqual("btc", obj.FromCurrency);
            Assert.AreEqual("eth", obj.ToCurrency);
            Assert.AreEqual(FlowEnum.FixedRate, obj.Flow);
            Assert.AreEqual("btc", obj.FromNetwork);
            Assert.AreEqual("eth", obj.ToNetwork);
            ExchangeRangeRequestConstruktorTestCommonAssert(obj);

            obj = new ExchangeRangeRequest("btc", "eth");

            Assert.AreEqual("btc", obj.FromCurrency);
            Assert.AreEqual("eth", obj.ToCurrency);
            Assert.AreEqual(FlowEnum.Standard, obj.Flow);
            Assert.AreEqual(string.Empty, obj.FromNetwork);
            Assert.AreEqual(string.Empty, obj.ToNetwork);
            ExchangeRangeRequestConstruktorTestCommonAssert(obj);
        }
 private void ExchangeRangeRequestConstruktorTestCommonAssert(ExchangeRangeRequest obj)
 {
     Assert.AreEqual(0, obj.ToAmount);
     Assert.AreEqual(0, obj.FromAmount);
     Assert.AreEqual(DirectionEnum.Direct, obj.Type);
 }
Exemple #4
0
        public async Task <ExchangeRangeResponse> GetExchangeRangeAsync(ExchangeRangeRequest request)
        {
            var response = await DoRequestAsync(GetExchangeRangeQueryString(request));

            return(ExchangeRangeResponseErrorHandle(response));
        }
Exemple #5
0
 public ExchangeRangeResponse GetExchangeRange(ExchangeRangeRequest request)
 {
     return(ExchangeRangeResponseErrorHandle(DoRequest(GetExchangeRangeQueryString(request))));
 }
Exemple #6
0
 private string GetExchangeRangeQueryString(ExchangeRangeRequest request)
 {
     return($"{ApiEndPoints.Exchange}range?fromCurrency={request.FromCurrency}&toCurrency={request.ToCurrency}&fromNetwork={request.FromNetwork}&toNetwork={request.ToNetwork}&flow={FlowEnumConverter.ToString(request.Flow)}");
 }