internal void SetUpServiceManagerForMocking(IApiConnection apiConnection, MarketInformationServiceFactory marketInformationServiceFactory, AccountInformationServiceFactory accountInformationServiceFactory, CfdMarketServiceFactory cfdMarketServiceFactory, OrderServiceFactory orderServiceFactory, FutureOptionServiceFactory futureOptionServiceFactory, MessageServiceFactory messageServiceFactory, NewsServiceFactory newsServiceFactory, SpreadMarketServiceFactory spreadMarketServiceFactory) { _apiConnection = apiConnection; _marketInformationServiceFactory = marketInformationServiceFactory; _accountInformationServiceFactory = accountInformationServiceFactory; _cfdMarketServiceFactory = cfdMarketServiceFactory; _orderServiceFactory = orderServiceFactory; _futureOptionServiceFactory = futureOptionServiceFactory; _messageServiceFactory = messageServiceFactory; _newsServiceFactory = newsServiceFactory; _spreadMarketServiceFactory = spreadMarketServiceFactory; }
public void Setup() { _mockApiConnection = MockRepository.GenerateMock<IApiConnection>(); _mockMarketInformationServiceFactory = MockRepository.GenerateMock<MarketInformationServiceFactory>(); _mockAccountInformationServiceFactory = MockRepository.GenerateMock<AccountInformationServiceFactory>(); _mockCfdMarketServiceFactory = MockRepository.GenerateMock<CfdMarketServiceFactory>(); _mockOrderServiceFactory = MockRepository.GenerateMock<OrderServiceFactory>(); _mockFutureOptionServiceFactory = MockRepository.GenerateMock<FutureOptionServiceFactory>(); _mockMessageServiceFactory = MockRepository.GenerateMock<MessageServiceFactory>(); _mockNewsServiceFactory = MockRepository.GenerateMock<NewsServiceFactory>(); _spreadMarketServiceFactory = MockRepository.GenerateMock<SpreadMarketServiceFactory>(); _serviceManager = new ServiceManager(); _serviceManager.SetUpServiceManagerForMocking( _mockApiConnection, _mockMarketInformationServiceFactory, _mockAccountInformationServiceFactory, _mockCfdMarketServiceFactory, _mockOrderServiceFactory, _mockFutureOptionServiceFactory, _mockMessageServiceFactory, _mockNewsServiceFactory, _spreadMarketServiceFactory); }
public void MarketServiceFactoryCreatesMarketInfoServiceWithAValidApiConnection() { var service = new MarketInformationServiceFactory().Create(_mockApiConnection); Assert.IsInstanceOfType(typeof(MarketInformationService), service); }