public void CancelOrderTest(string contractCode, string orderId, string clientOrderId, string offset, string direction) { var result = client.CancelOrderAsync(contractCode, orderId, clientOrderId, offset, direction).Result; string strret = JsonConvert.SerializeObject(result, Formatting.Indented); Console.WriteLine(strret); Assert.Equal("ok", result.status); }
public async Task CanCancelCreatedOrder() { // If: we create a new order OrderRequest orderRequest = CreateOrderRequestWithOnlyRequiredFields(); OrderResponse createdOrder = await OrderClient.CreateOrderAsync(orderRequest); // When: We attempt to cancel the order and then retrieve it await OrderClient.CancelOrderAsync(createdOrder.Id); OrderResponse canceledOrder = await OrderClient.GetOrderAsync(createdOrder.Id); // Then: The order status should be cancelled Assert.AreEqual(OrderStatus.Canceled, canceledOrder.Status); }