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); }
public async Task <MinimalExchangeResponse> GetMinimalExchangeAmountAsync(MinimalExchangeRequest request) { var response = await DoRequestAsync(GetMinimalExchangeAmountQueryString(request)); return(MinimalExchangeResponseErrorHandle(response)); }
public MinimalExchangeResponse GetMinimalExchangeAmount(MinimalExchangeRequest request) { return(MinimalExchangeResponseErrorHandle(DoRequest(GetMinimalExchangeAmountQueryString(request)))); }
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)}"); }