Exemple #1
0
        public async Task Should_set_currency_balance()
        {
            var request = new SandboxSetCurrencyBalanceRequest()
            {
                Currency = Currency.Usd,
                Balance  = 100000
            };

            var response = await _sandboxService.SetCurrencyBalance(request, CancellationToken.None);

            ValidateRestResponse(response);
        }
        public async Task Should_place_limit_order()
        {
            var balanceSetResponse = await _sandboxService.SetCurrencyBalance(new SandboxSetCurrencyBalanceRequest
            {
                Balance  = 200,
                Currency = Currency.Usd
            });

            ValidateRestResponse(balanceSetResponse);

            var request = new PlaceLimitOrderPayload
            {
                Lots      = 1,
                Operation = OperationType.Buy,
                Price     = 180
            };

            var response = await _orderService.PlaceLimitOrder("BBG000D9D830", request);

            ValidateRestResponse(response);
            Assert.NotNull(response.Order);
            Assert.Equal(OrderStatus.Fill, response.Order.Status);
        }