Exemple #1
0
 internal OrderService(OpenPositionsQuery openPositionsQuery, OrderQuery orderQuery, StopLimitOrderHistoryQuery stopLimitOrderHistoryQuery, NewStopLimitOrderPlacer newStopLimitOrderPlacer, NewTradeOrderPlacer newTradeOrderPlacer, CancelOrderPlacer cancelOrderPlacer, ActiveStopLimitOrderQuery activeStopLimitOrderQuery, TradeHistoryQuery tradeHistoryQuery)
 {
     _openPositionsQuery         = openPositionsQuery;
     _orderQuery                 = orderQuery;
     _stopLimitOrderHistoryQuery = stopLimitOrderHistoryQuery;
     _newStopLimitOrderPlacer    = newStopLimitOrderPlacer;
     _newTradeOrderPlacer        = newTradeOrderPlacer;
     _cancelOrderPlacer          = cancelOrderPlacer;
     _activeStopLimitOrderQuery  = activeStopLimitOrderQuery;
     _tradeHistoryQuery          = tradeHistoryQuery;
 }
 internal OrderService(OpenPositionsQuery openPositionsQuery, OrderQuery orderQuery, StopLimitOrderHistoryQuery stopLimitOrderHistoryQuery, NewStopLimitOrderPlacer newStopLimitOrderPlacer, NewTradeOrderPlacer newTradeOrderPlacer, CancelOrderPlacer cancelOrderPlacer, ActiveStopLimitOrderQuery activeStopLimitOrderQuery, TradeHistoryQuery tradeHistoryQuery)
 {
     _openPositionsQuery = openPositionsQuery;
     _orderQuery = orderQuery;
     _stopLimitOrderHistoryQuery = stopLimitOrderHistoryQuery;
     _newStopLimitOrderPlacer = newStopLimitOrderPlacer;
     _newTradeOrderPlacer = newTradeOrderPlacer;
     _cancelOrderPlacer = cancelOrderPlacer;
     _activeStopLimitOrderQuery = activeStopLimitOrderQuery;
     _tradeHistoryQuery = tradeHistoryQuery;
 }
Exemple #3
0
        public void Setup()
        {
            _mockConnection                 = MockRepository.GenerateMock <Connection>("username", "password", "http://couldBeAnyUrl/TradingApi");
            _mockOpenPositionsQuery         = MockRepository.GenerateMock <OpenPositionsQuery>(_mockConnection);
            _mockOrderQuery                 = MockRepository.GenerateMock <OrderQuery>(_mockConnection);
            _mockStopLimitOrderHistoryQuery = MockRepository.GenerateMock <StopLimitOrderHistoryQuery>(_mockConnection);
            _mockNewStopLimitOrderPlacer    = MockRepository.GenerateMock <NewStopLimitOrderPlacer>(_mockConnection);
            _mockNewTradeOrderPlacer        = MockRepository.GenerateMock <NewTradeOrderPlacer>(_mockConnection);
            _mockCancelOrderPlacer          = MockRepository.GenerateMock <CancelOrderPlacer>(_mockConnection);
            _mockActiveStopLimitOrderQuery  = MockRepository.GenerateMock <ActiveStopLimitOrderQuery>(_mockConnection);
            _mockTradeHistoryQuery          = MockRepository.GenerateMock <TradeHistoryQuery>(_mockConnection);

            _orderService = new OrderService(_mockOpenPositionsQuery, _mockOrderQuery, _mockStopLimitOrderHistoryQuery, _mockNewStopLimitOrderPlacer, _mockNewTradeOrderPlacer, _mockCancelOrderPlacer, _mockActiveStopLimitOrderQuery, _mockTradeHistoryQuery);
        }
        public void Setup()
        {
            _mockConnection = MockRepository.GenerateMock<Connection>("username", "password", "http://couldBeAnyUrl/TradingApi");
            _mockOpenPositionsQuery = MockRepository.GenerateMock<OpenPositionsQuery>(_mockConnection);
            _mockOrderQuery = MockRepository.GenerateMock<OrderQuery>(_mockConnection);
            _mockStopLimitOrderHistoryQuery = MockRepository.GenerateMock<StopLimitOrderHistoryQuery>(_mockConnection);
            _mockNewStopLimitOrderPlacer = MockRepository.GenerateMock<NewStopLimitOrderPlacer>(_mockConnection);
            _mockNewTradeOrderPlacer = MockRepository.GenerateMock<NewTradeOrderPlacer>(_mockConnection);
            _mockCancelOrderPlacer = MockRepository.GenerateMock<CancelOrderPlacer>(_mockConnection);
            _mockActiveStopLimitOrderQuery = MockRepository.GenerateMock<ActiveStopLimitOrderQuery>(_mockConnection);
            _mockTradeHistoryQuery = MockRepository.GenerateMock<TradeHistoryQuery>(_mockConnection);

            _orderService = new OrderService(_mockOpenPositionsQuery, _mockOrderQuery, _mockStopLimitOrderHistoryQuery, _mockNewStopLimitOrderPlacer, _mockNewTradeOrderPlacer, _mockCancelOrderPlacer, _mockActiveStopLimitOrderQuery, _mockTradeHistoryQuery);
        }