Ejemplo n.º 1
0
        public async Task PlaceThrows()
        {
            var user = new BinanceApiUser("api-key");

            await Assert.ThrowsAsync <ArgumentNullException>("clientOrder", () => _api.PlaceAsync(null));

            await Assert.ThrowsAsync <InvalidOperationException>(() => _api.PlaceAsync(new LimitOrder(user)
            {
                Symbol = Symbol.BTC_USDT, Quantity = 0.01m
            }));
        }
Ejemplo n.º 2
0
        public async Task <Interface.Model.Order> PlaceOrder(Interface.Model.User user, Interface.Model.ClientOrder clientOrder, long recWindow = 0, CancellationToken cancellationToken = default(CancellationToken))
        {
            var order  = OrderHelper.GetOrder(user, clientOrder);
            var result = await binanceApi.PlaceAsync(order).ConfigureAwait(false);

            return(NewOrder(user, result));
        }
 public async Task PlaceThrows()
 {
     await Assert.ThrowsAsync <ArgumentNullException>("clientOrder", () => _api.PlaceAsync(null));
 }