public void Init() { _browserApi = Substitute.For <IBrowsersManagerApi, ICommunicationObject>(); _serviceStarter = Substitute.For <IServiceBuilder <IBrowsersManagerApi> >(); _serviceStarter.CreateServiceAndTryToConnect().Returns(_browserApi); _uiHelper = Substitute.For <IUiHelper>(); _log = Substitute.For <ILogger>(); _communicationObject = (ICommunicationObject)_browserApi; _browserWindowsCommunicator = new BrowserWindowsCommunicator(_serviceStarter, _uiHelper, _log); }
public void Init() { _service = Substitute.For <IBrowsersManagerApi, ICommunicationObject>(); _serviceStarter = Substitute.For <IServiceBuilder <IBrowsersManagerApi> >(); _serviceStarter.CreateServiceAndTryToConnect().Returns(_service); _uiHelper = Substitute.For <IUiHelper>(); _log = Substitute.For <ILogger>(); _communicationObject = (ICommunicationObject)_service; _serviceClient = new AbstractServiceClient <IBrowsersManagerApi>(_serviceStarter, _uiHelper, _log); }
public void Init() { _browserApi = Substitute.For<IBrowsersManagerApi, ICommunicationObject>(); _serviceStarter = Substitute.For<IServiceBuilder<IBrowsersManagerApi>>(); _serviceStarter.CreateServiceAndTryToConnect().Returns(_browserApi); _uiHelper = Substitute.For<IUiHelper>(); _log = Substitute.For<ILogger>(); _communicationObject = (ICommunicationObject)_browserApi; _browserWindowsCommunicator = new BrowserWindowsCommunicator(_serviceStarter, _uiHelper, _log); }
public void Init() { _service = Substitute.For<IBrowsersManagerApi, ICommunicationObject>(); _serviceStarter = Substitute.For<IServiceBuilder<IBrowsersManagerApi>>(); _serviceStarter.CreateServiceAndTryToConnect().Returns(_service); _uiHelper = Substitute.For<IUiHelper>(); _log = Substitute.For<ILogger>(); _communicationObject = (ICommunicationObject)_service; _serviceClient = new AbstractServiceClient<IBrowsersManagerApi>(_serviceStarter, _uiHelper, _log); }
public void Start() { _log.Info("Starting service " + typeof(T).FullName); _failedState = true; var service = _serviceStarter.CreateServiceAndTryToConnect(); if (!(service is ICommunicationObject)) { throw new InvalidOperationException("Service is not an instance of ICommunicationObject"); } _communicationObject = (ICommunicationObject)service; _failedState = false; _log.Info("Service " + typeof(T).FullName + " was started."); }