public void CreateLimitOrder_SendCreateOrderCommand_ReturnNewOrderRepresentationAndPublishOrderToDisruptor() { NewOrderRepresentation representation = _orderseService.CreateOrder(new CreateOrderCommand(10, "limit", "buy", "XBTUSD", 10, "1234")); _manualResetEvent.WaitOne(3000); Assert.AreEqual(representation.OrderId, _receivedOrder.OrderId.Id.ToString()); }
/// <summary> /// Extracts OrderID from the HttpActionresult /// </summary> /// <param name="httpActionResult"></param> /// <returns></returns> public string GetOrderId(IHttpActionResult httpActionResult) { OkNegotiatedContentResult <NewOrderRepresentation> okResponseMessage = (OkNegotiatedContentResult <NewOrderRepresentation>)httpActionResult; NewOrderRepresentation newOrderRepresentation = okResponseMessage.Content; return(newOrderRepresentation.OrderId); }
public void CreateOrder_SendCreateOrderCommandWithInvalidOrderType_ThrowException() { NewOrderRepresentation representation = _orderseService.CreateOrder(new CreateOrderCommand(0, "mar", "buy", "XBTUSD", 10, "1234")); _manualResetEvent.WaitOne(3000); }