예제 #1
0
        public async Task GetOrders_ReturnsOrders()
        {
            // Arrange
            var options    = CreateOptions();
            var httpClient = new HttpClient();
            var client     = new BotsOrderApi(options, httpClient);

            // Act
            var result = await client.GetOrders();

            // Assert
            result.Should().NotBeNull();
        }
예제 #2
0
        public async Task CancelAllOpenOrders()
        {
            // Arrange
            var options    = CreateOptions();
            var httpClient = new HttpClient();
            var client     = new BotsOrderApi(options, httpClient);

            // Act
            var result = await client.GetOrders();

            foreach (var order in result.Orders)
            {
                var cancelOrderResult = await client.CancelOrder(new CancelOrderRequest {
                    ExternalOrderId = order.ExternalId
                });

                cancelOrderResult.Success.Should().BeTrue();
            }

            // Assert
            result.Should().NotBeNull();
        }