示例#1
0
        public void GetMinimalExchangeAmountTest(string fromCurrency, string toCurrency, FlowEnum flow, string fromNetwork, string toNetwork)
        {
            var request = new MinimalExchangeRequest(fromCurrency, toCurrency, flow, fromNetwork, toNetwork);

            var result = _client.GetMinimalExchangeAmount(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 MinimalExchangeRequestConstruktor()
        {
            var obj = new MinimalExchangeRequest("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);
            MinimalExchangeRequestConstruktorTestCommonAssert(obj);

            obj = new MinimalExchangeRequest("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);
            MinimalExchangeRequestConstruktorTestCommonAssert(obj);
        }
 private void MinimalExchangeRequestConstruktorTestCommonAssert(MinimalExchangeRequest obj)
 {
     Assert.AreEqual(0, obj.ToAmount);
     Assert.AreEqual(0, obj.FromAmount);
     Assert.AreEqual(DirectionEnum.Direct, obj.Type);
 }
示例#4
0
        public async Task <MinimalExchangeResponse> GetMinimalExchangeAmountAsync(MinimalExchangeRequest request)
        {
            var response = await DoRequestAsync(GetMinimalExchangeAmountQueryString(request));

            return(MinimalExchangeResponseErrorHandle(response));
        }
示例#5
0
 public MinimalExchangeResponse GetMinimalExchangeAmount(MinimalExchangeRequest request)
 {
     return(MinimalExchangeResponseErrorHandle(DoRequest(GetMinimalExchangeAmountQueryString(request))));
 }
示例#6
0
 private string GetMinimalExchangeAmountQueryString(MinimalExchangeRequest request)
 {
     return($"{ApiEndPoints.Exchange}min-amount?fromCurrency={request.FromCurrency}&toCurrency={request.ToCurrency}&fromNetwork={request.FromNetwork}&toNetwork={request.ToNetwork}&flow={FlowEnumConverter.ToString(request.Flow)}");
 }