public ICommand CreateSendAcceptNewOrder(FixSessionID sessionID, IOrder order) { return new SendAcceptNewOrder(_sessionMediator, sessionID, order); }
public ICommand CreateSendAcceptNewOrder(FixSessionID sessionID, IOrder order) { return(new SendAcceptNewOrder(_sessionMediator, sessionID, order)); }
public SendAcceptNewOrder(SessionMediator sessionMediator, FixSessionID sessionID, IOrder order) { _sessionMediator = sessionMediator; _sessionID = sessionID; _order = order; }
public SendOrderFill(SessionMediator sessionMediator, OrderMatch orderMatch, FixSessionID sessionID) { _sessionMediator = sessionMediator; _orderMatch = orderMatch; _sessionID = sessionID; }
public ICommand CreateSendAcceptOrderCancel(IFixMessageGenerator messageGenerator, IOrder cancelledOrder, string execID, FixSessionID sessionID) { return(new SendAcceptOrderCancel(messageGenerator, _sessionMediator, cancelledOrder, execID, sessionID)); }
public SendAcceptOrderCancel(IFixMessageGenerator messageGenerator, SessionMediator sessionMediator, IOrder cancelledOrder, string execID, FixSessionID sessionID) { _messageGenerator = messageGenerator; _sessionMediator = sessionMediator; _order = cancelledOrder; _execID = execID; _sessionID = sessionID; }
public ICommand CreateAddOrder(IFixMessageGenerator fixMessageGenerator, FixSessionID sessionID, OrderData orderData, string execID) { return(new AddOrder(this, fixMessageGenerator, _orderMediator, sessionID, orderData, execID)); }
public ICommand CreateAddOrder(IFixMessageGenerator fixMessageGenerator, FixSessionID sessionID, OrderData orderData, string execID) { return new AddOrder(this, fixMessageGenerator, _orderMediator, sessionID, orderData, execID); }
public AddOrder(CommandFactory commandFactory, IFixMessageGenerator fixMessageGenerator, OrderMediator orderMediator, FixSessionID sessionID, OrderData orderData, string execID) { _commandFactory = commandFactory; _fixMessageGenerator = fixMessageGenerator; _orderMediator = orderMediator; _sessionID = sessionID; _orderData = orderData; _execID = execID; }
public ICommand CreateSendRejectNewOrder(IFixMessageGenerator fixMessageGenerator, FixSessionID sessionID, OrderData orderData, string execID, string rejectionMessage, int?rejectionCode) { return(new SendRejectNewOrder(fixMessageGenerator, _sessionMediator, orderData, execID, rejectionMessage, rejectionCode, sessionID)); }
public ICommand CreateCancelOrder(IFixMessageGenerator fixMessageGenerator, FixSessionID sessionID, long orderID, string clOrdID, string origClOrdID, string execID) { return new CancelOrder(this, fixMessageGenerator, _orderMediator, sessionID, orderID, clOrdID, origClOrdID, execID); }
public SendRejectNewOrder(IFixMessageGenerator messageGenerator, SessionMediator sessionMediator, OrderData orderData, string execID, string rejectionMessage, int?rejectionCode, FixSessionID sessionID) { _messageGenerator = messageGenerator; _sessionMediator = sessionMediator; _order = orderData; _execID = execID; _rejectionMessage = rejectionMessage; _rejectionCode = rejectionCode; _sessionID = sessionID; }
public SendRejectNewOrder(IFixMessageGenerator messageGenerator, SessionMediator sessionMediator, OrderData orderData, string execID, string rejectionMessage, int? rejectionCode, FixSessionID sessionID) { _messageGenerator = messageGenerator; _sessionMediator = sessionMediator; _order = orderData; _execID = execID; _rejectionMessage = rejectionMessage; _rejectionCode = rejectionCode; _sessionID = sessionID; }
public ICommand CreateCancelOrder(IFixMessageGenerator fixMessageGenerator, FixSessionID sessionID, long orderID, string clOrdID, string origClOrdID, string execID) { return(new CancelOrder(this, fixMessageGenerator, _orderMediator, sessionID, orderID, clOrdID, origClOrdID, execID)); }
public ICommand CreateSendRejectOrderCancel(IFixMessageGenerator messageGenerator, int rejectionReason, string rejectionReasonText, long orderID, string clOrdID, string origClOrdID, FixSessionID sessionID) { return(new SendRejectOrderCancel(messageGenerator, _sessionMediator, rejectionReason, rejectionReasonText, orderID, clOrdID, origClOrdID, sessionID)); }
public SendRejectOrderCancel(IFixMessageGenerator messageGenerator, SessionMediator sessionMediator, int rejectionReason, string rejectionReasonText, long orderID, string clOrdID, string origClOrdID, FixSessionID sessionID) { _messageGenerator = messageGenerator; _sessionMediator = sessionMediator; _rejectionReason = rejectionReason; _rejectionReasonText = rejectionReasonText; _orderID = orderID; _clOrdID = clOrdID; _origClOrdID = origClOrdID; _sessionID = sessionID; }
public CancelOrder(CommandFactory commandFactory, IFixMessageGenerator messageGenerator, OrderMediator orderMediator, FixSessionID sessionID, long orderID, string clOrdID, string origClOrdID, string execID) { _commandFactory = commandFactory; _messageGenerator = messageGenerator; _orderMediator = orderMediator; _sessionID = sessionID; _orderID = orderID; _clOrdID = clOrdID; _origClOrdID = origClOrdID; _execID = execID; }
public void CancellingAnOrderWhenYouAreTheOwningSessionSucceeds() { var mockRepository = new Mock <IOrderRepository>(); var o = DefaultOrder(1); mockRepository.Setup(r => r.AddOrder(o.ID, o.Contract, o.OrderType, o.MarketSide, o.Price, o.Quantity, o.ClOrdID, o.Account)) .Returns(o); mockRepository.Setup(r => r.DeleteOrder(o.ID)).Returns(o); Action <OrderMatch, FixSessionID> emptyMatchCallback = (m, s) => { }; var mediator = new OrderMediator(mockRepository.Object, emptyMatchCallback); var fakeSessionId = new FixSessionID(); var addedOrder = mediator.AddOrder(fakeSessionId, o.OrderType, o.Contract.Symbol, o.MarketSide, o.ClOrdID, o.Account, o.Quantity, o.Price); Assert.AreEqual(o.ID, addedOrder.ID); Assert.AreEqual(o.ClOrdID, addedOrder.ClOrdID); var cancelledOrder = mediator.CancelOrder(addedOrder.ID, fakeSessionId); Assert.IsNotNull(cancelledOrder, "Cancelled order should not be null"); mockRepository.Verify(r => r.DeleteOrder(o.ID), Times.Once()); Assert.AreEqual(o.ID, cancelledOrder.ID); Assert.AreEqual(o.ClOrdID, cancelledOrder.ClOrdID); }
public void CancellingAnOrderWhenYouAreNotTheOwningSessionFails() { var mockRepository = new Mock <IOrderRepository>(); var o = DefaultOrder(1); mockRepository.Setup(r => r.AddOrder(o.ID, o.Contract, o.OrderType, o.MarketSide, o.Price, o.Quantity, o.ClOrdID, o.Account)) .Returns(o); Action <OrderMatch, FixSessionID> emptyMatchCallback = (m, s) => { }; var mediator = new OrderMediator(mockRepository.Object, emptyMatchCallback); var fakeSessionId1 = new FixSessionID(); var fakeSessionId2 = new FixSessionID(); Assert.AreNotEqual(fakeSessionId1, fakeSessionId2); var addedOrder = mediator.AddOrder(fakeSessionId1, o.OrderType, o.Contract.Symbol, o.MarketSide, o.ClOrdID, o.Account, o.Quantity, o.Price); Assert.Throws <FixATServerException>( () => mediator.CancelOrder(addedOrder.ID, fakeSessionId2)); mockRepository.Verify(r => r.DeleteOrder(o.ID), Times.Never()); }
public ICommand CreateSendAcceptOrderCancel(IFixMessageGenerator messageGenerator, IOrder cancelledOrder, string execID, FixSessionID sessionID) { return new SendAcceptOrderCancel(messageGenerator, _sessionMediator, cancelledOrder, execID, sessionID); }
public ICommand CreateSendRejectNewOrder(IFixMessageGenerator fixMessageGenerator, FixSessionID sessionID, OrderData orderData, string execID, string rejectionMessage, int? rejectionCode) { return new SendRejectNewOrder(fixMessageGenerator, _sessionMediator, orderData, execID, rejectionMessage, rejectionCode, sessionID); }
public ICommand CreateSendRejectOrderCancel(IFixMessageGenerator messageGenerator, int rejectionReason, string rejectionReasonText, long orderID, string clOrdID, string origClOrdID, FixSessionID sessionID) { return new SendRejectOrderCancel(messageGenerator, _sessionMediator, rejectionReason, rejectionReasonText, orderID, clOrdID, origClOrdID, sessionID); }
public ICommand CreateSendOrderFill(OrderMatch orderMatch, FixSessionID sessionID) { return(new SendOrderFill(_sessionMediator, orderMatch, sessionID)); }
public ICommand CreateSendOrderFill(OrderMatch orderMatch, FixSessionID sessionID) { return new SendOrderFill(_sessionMediator, orderMatch, sessionID); }