コード例 #1
0
ファイル: CommandFactory.cs プロジェクト: naziway/testtask
 public ICommand CreateSendAcceptNewOrder(FixSessionID sessionID,
                                          IOrder order)
 {
     return new SendAcceptNewOrder(_sessionMediator,
                                   sessionID,
                                   order);
 }
コード例 #2
0
ファイル: CommandFactory.cs プロジェクト: mjheller/wpffix
 public ICommand CreateSendAcceptNewOrder(FixSessionID sessionID,
                                          IOrder order)
 {
     return(new SendAcceptNewOrder(_sessionMediator,
                                   sessionID,
                                   order));
 }
コード例 #3
0
ファイル: SendAcceptNewOrder.cs プロジェクト: mjheller/wpffix
 public SendAcceptNewOrder(SessionMediator sessionMediator,
                           FixSessionID sessionID,
                           IOrder order)
 {
     _sessionMediator = sessionMediator;
     _sessionID       = sessionID;
     _order           = order;
 }
コード例 #4
0
 public SendOrderFill(SessionMediator sessionMediator,
                      OrderMatch orderMatch,
                      FixSessionID sessionID)
 {
     _sessionMediator = sessionMediator;
     _orderMatch      = orderMatch;
     _sessionID       = sessionID;
 }
コード例 #5
0
 public SendAcceptNewOrder(SessionMediator sessionMediator,
                           FixSessionID sessionID,
                           IOrder order)
 {
     _sessionMediator = sessionMediator;
     _sessionID = sessionID;
     _order = order;
 }
コード例 #6
0
ファイル: SendOrderFill.cs プロジェクト: naziway/testtask
 public SendOrderFill(SessionMediator sessionMediator,
                      OrderMatch orderMatch,
                      FixSessionID sessionID)
 {
     _sessionMediator = sessionMediator;
     _orderMatch = orderMatch;
     _sessionID = sessionID;
 }
コード例 #7
0
ファイル: CommandFactory.cs プロジェクト: mjheller/wpffix
 public ICommand CreateSendAcceptOrderCancel(IFixMessageGenerator messageGenerator,
                                             IOrder cancelledOrder,
                                             string execID,
                                             FixSessionID sessionID)
 {
     return(new SendAcceptOrderCancel(messageGenerator,
                                      _sessionMediator,
                                      cancelledOrder,
                                      execID,
                                      sessionID));
 }
コード例 #8
0
 public SendAcceptOrderCancel(IFixMessageGenerator messageGenerator,
                              SessionMediator sessionMediator,
                              IOrder cancelledOrder,
                              string execID,
                              FixSessionID sessionID)
 {
     _messageGenerator = messageGenerator;
     _sessionMediator  = sessionMediator;
     _order            = cancelledOrder;
     _execID           = execID;
     _sessionID        = sessionID;
 }
コード例 #9
0
ファイル: CommandFactory.cs プロジェクト: mjheller/wpffix
 public ICommand CreateAddOrder(IFixMessageGenerator fixMessageGenerator,
                                FixSessionID sessionID,
                                OrderData orderData,
                                string execID)
 {
     return(new AddOrder(this,
                         fixMessageGenerator,
                         _orderMediator,
                         sessionID,
                         orderData,
                         execID));
 }
コード例 #10
0
 public SendAcceptOrderCancel(IFixMessageGenerator messageGenerator,
                              SessionMediator sessionMediator,
                              IOrder cancelledOrder,
                              string execID,
                              FixSessionID sessionID)
 {
     _messageGenerator = messageGenerator;
     _sessionMediator = sessionMediator;
     _order = cancelledOrder;
     _execID = execID;
     _sessionID = sessionID;
 }
コード例 #11
0
ファイル: CommandFactory.cs プロジェクト: naziway/testtask
 public ICommand CreateAddOrder(IFixMessageGenerator fixMessageGenerator,
                                FixSessionID sessionID,
                                OrderData orderData,
                                string execID)
 {
     return new AddOrder(this,
                         fixMessageGenerator,
                         _orderMediator,
                         sessionID,
                         orderData,
                         execID);
 }
コード例 #12
0
ファイル: AddOrder.cs プロジェクト: naziway/testtask
 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;
 }
コード例 #13
0
ファイル: AddOrder.cs プロジェクト: mjheller/wpffix
 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;
 }
コード例 #14
0
ファイル: CommandFactory.cs プロジェクト: mjheller/wpffix
 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));
 }
コード例 #15
0
ファイル: CommandFactory.cs プロジェクト: naziway/testtask
 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);
 }
コード例 #16
0
 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;
 }
コード例 #17
0
 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;
 }
コード例 #18
0
ファイル: CommandFactory.cs プロジェクト: mjheller/wpffix
 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));
 }
コード例 #19
0
ファイル: CommandFactory.cs プロジェクト: mjheller/wpffix
 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));
 }
コード例 #20
0
 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;
 }
コード例 #21
0
ファイル: CancelOrder.cs プロジェクト: naziway/testtask
 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;
 }
コード例 #22
0
 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;
 }
コード例 #23
0
 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;
 }
コード例 #24
0
        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);
        }
コード例 #25
0
        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());
        }
コード例 #26
0
ファイル: CommandFactory.cs プロジェクト: naziway/testtask
 public ICommand CreateSendAcceptOrderCancel(IFixMessageGenerator messageGenerator,
                                             IOrder cancelledOrder,
                                             string execID,
                                             FixSessionID sessionID)
 {
     return new SendAcceptOrderCancel(messageGenerator,
                                      _sessionMediator,
                                      cancelledOrder,
                                      execID,
                                      sessionID);
 }
コード例 #27
0
ファイル: CommandFactory.cs プロジェクト: naziway/testtask
 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);
 }
コード例 #28
0
ファイル: CommandFactory.cs プロジェクト: naziway/testtask
 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);
 }
コード例 #29
0
ファイル: CommandFactory.cs プロジェクト: mjheller/wpffix
 public ICommand CreateSendOrderFill(OrderMatch orderMatch, FixSessionID sessionID)
 {
     return(new SendOrderFill(_sessionMediator, orderMatch, sessionID));
 }
コード例 #30
0
ファイル: CommandFactory.cs プロジェクト: naziway/testtask
 public ICommand CreateSendOrderFill(OrderMatch orderMatch, FixSessionID sessionID)
 {
     return new SendOrderFill(_sessionMediator, orderMatch, sessionID);
 }