public void TestCloseBrowserProcessCallsShutdown() { _uiHelper = Substitute.For<IUiHelper>(); _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper); _browsersManagerApi.CloseBrowserProcess(); _uiHelper.Received().GracefulShutdown(); }
public ExplorerWatcher(ILogger logger, IUiHelper uiHelper, Action actionOnStartup, Action actionOnShutdown) { _logger = logger; _uiHelper = uiHelper; _actionOnStartup = actionOnStartup; _actionOnShutdown = actionOnShutdown; }
public void TestCloseBrowserProcessCallsShutdown() { _uiHelper = Substitute.For <IUiHelper>(); _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper); _browsersManagerApi.CloseBrowserProcess(); _uiHelper.Received().GracefulShutdown(); }
public void TestCloseAllApplicationsAndRemoveSessionInfoRemovesSessionInfo() { _uiHelper = Substitute.For<IUiHelper>(); _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper); var appDirectSession = _browserWindowsManager.Session; _browsersManagerApi.CloseAllApplicationsAndRemoveSessionInfo(); Assert.AreNotEqual(appDirectSession, _browserWindowsManager.Session); }
public void TestCloseAllApplicationsAndRemoveSessionInfoRemovesSessionInfo() { _uiHelper = Substitute.For <IUiHelper>(); _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper); var appDirectSession = _browserWindowsManager.Session; _browsersManagerApi.CloseAllApplicationsAndRemoveSessionInfo(); Assert.AreNotEqual(appDirectSession, _browserWindowsManager.Session); }
public void TestDisplayApplicationCallGetOrCreateBrowserWindow() { _uiHelper = Substitute.For<IUiHelper>(); var windowMock = Substitute.For<IBrowserWindow>(); _browserWindowsManager.GetOrCreateBrowserWindow(null).ReturnsForAnyArgs(windowMock); _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper); _browsersManagerApi.DisplayApplication(new Application()); _browserWindowsManager.Received().GetOrCreateBrowserWindow(Arg.Any<IApplication>()); }
public void Init() { _uiHelper = new TestUiHelper(); _browserObject = Substitute.For <IBrowserObject>(); _browserWindowMock = Substitute.For <IBrowserWindow>(); _browserWindowBuilder = new TestBrowserWindowsBuilder(_browserWindowMock); _browserWindowsManager = new BrowserWindowsManager(_browserObject, _uiHelper, _browserWindowBuilder); }
public void Init() { _uiHelper = new TestUiHelper(); _browserObject = Substitute.For<IBrowserObject>(); _browserWindowMock = Substitute.For<IBrowserWindow>(); _browserWindowBuilder = new TestBrowserWindowsBuilder(_browserWindowMock); _browserWindowsManager = new BrowserWindowsManager(_browserObject, _uiHelper, _browserWindowBuilder); }
public void TestDisplayApplicationCallGetOrCreateBrowserWindow() { _uiHelper = Substitute.For <IUiHelper>(); var windowMock = Substitute.For <IBrowserWindow>(); _browserWindowsManager.GetOrCreateBrowserWindow(null).ReturnsForAnyArgs(windowMock); _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper); _browsersManagerApi.DisplayApplication(new Application()); _browserWindowsManager.Received().GetOrCreateBrowserWindow(Arg.Any <IApplication>()); }
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() { _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() { _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 TaskbarPanel(ILatch latch, ILogger logger, MainViewModel mainViewModel, IUiHelper uiHelper) { _log = logger; _mainViewModel = mainViewModel; _uiHelper = uiHelper; InitializeComponent(); InitializeMainWindowLatch = latch; ViewModel = new TaskbarPanelViewModel(_mainViewModel.MyApplications.Where(a => a.Application.PinnedToTaskbar && !a.IsUnsupported).ToList()); DataContext = ViewModel; }
public BrowsersManagerApi(IBrowserWindowsManager browserWindowsManager, IUiHelper uiHelper) { if (browserWindowsManager == null) { throw new ArgumentNullException("browserWindowsManager"); } if (uiHelper == null) { throw new ArgumentNullException("uiHelper"); } _browserWindowsManager = browserWindowsManager; _uiHelper = uiHelper; }
public WpfCefRenderHandler(AvaloniaCefBrowser owner, IUiHelper uiHelper) { if (owner == null) { throw new ArgumentNullException("owner"); } if (uiHelper == null) { throw new ArgumentNullException("uiHelper"); } _owner = owner; _uiHelper = uiHelper; }
public BrowserWindowsManager(IBrowserObject browserObject, IUiHelper uiHelper, IBrowserWindowsBuilder<IBrowserWindow> browserWindowsBuilder) { if (browserObject == null) { throw new ArgumentNullException("browserObject"); } if (uiHelper == null) { throw new ArgumentNullException("uiHelper"); } _browserObject = browserObject; _uiHelper = uiHelper; _browserWindowsBuilder = browserWindowsBuilder; }
public BrowserWindowsManager(IBrowserObject browserObject, IUiHelper uiHelper, IBrowserWindowsBuilder <IBrowserWindow> browserWindowsBuilder) { if (browserObject == null) { throw new ArgumentNullException("browserObject"); } if (uiHelper == null) { throw new ArgumentNullException("uiHelper"); } _browserObject = browserObject; _uiHelper = uiHelper; _browserWindowsBuilder = browserWindowsBuilder; }
//public BaseViewModel() //{ //} // public ServiceClient.ServiceClient Servicebroker = new ServiceClient.ServiceClient { BaseUrl = SuperApp.Instance.DEV_Endpoint, TokenKey = SuperApp.Instance.CurrentTokenKey }; public BaseViewModel(IConnectivityService connectivityService , IUiHelper uiHelper , INavigationService navigationService , ILogger logger) { ConnectivityService = connectivityService; UiHelper = uiHelper; NavigationService = navigationService; Logger = logger; // will this fire in previous loaded viewmodels???? CrossConnectivity.Current.ConnectivityTypeChanged += (object sender, Plugin.Connectivity.Abstractions.ConnectivityTypeChangedEventArgs e) => { NotifyPropertyChanged("InternetConnection"); }; }
private TaskbarPanel CreateTaskbarPanel(MainViewModel mainViewModel, IUiHelper uiHelper) { try { var taskbarPanel = new TaskbarPanel(_mainWindowReadyLatch, new NLogLogger("TaskbarPanel"), mainViewModel, uiHelper); taskbarPanel.InitializeButtons(); return(taskbarPanel); } catch (Exception ex) { _log.ErrorException("Failed to initialize taskbar module", ex); uiHelper.ShowMessage(ex.ToString()); uiHelper.IgnoreException(_instanceMutex.ReleaseMutex); _instanceMutex = null; Current.Shutdown(); Environment.Exit(0); } return(null); }
public AbstractServiceClient(IServiceBuilder <T> serviceStarter, IUiHelper uiHelper, ILogger log) { if (serviceStarter == null) { throw new ArgumentNullException("serviceStarter"); } if (uiHelper == null) { throw new ArgumentNullException("uiHelper"); } if (log == null) { throw new ArgumentNullException("log"); } _serviceStarter = serviceStarter; _uiHelper = uiHelper; _log = log; }
public WpfCefRenderHandler(WpfCefBrowser owner, ILogger logger, IUiHelper uiHelper) { if (owner == null) { throw new ArgumentNullException("owner"); } if (logger == null) { throw new ArgumentNullException("logger"); } if (uiHelper == null) { throw new ArgumentNullException("uiHelper"); } _owner = owner; _logger = logger; _uiHelper = uiHelper; }
public SessionKeeper(MainApplicationServiceClient mainAppClient, IBrowserWindowsManager browserWindowsManager, IBrowserWindowsBuilder<IBrowserWindow> browserWindowsBuilder, ILogger log, IUiHelper uiHelper) { if (mainAppClient == null) { throw new ArgumentNullException("mainAppClient"); } if (browserWindowsManager == null) { throw new ArgumentNullException("browserWindowsManager"); } if (browserWindowsBuilder == null) { throw new ArgumentNullException("browserWindowsBuilder"); } if (log == null) { throw new ArgumentNullException("log"); } if (uiHelper == null) { throw new ArgumentNullException("uiHelper"); } _mainAppClient = mainAppClient; _log = log; _uiHelper = uiHelper; _sessionUpdator = KeepUpdatingSession; _browserWindowsManager = browserWindowsManager; _browserWindowsBuilder = browserWindowsBuilder; _updaterThread = new Thread(_sessionUpdator); }
public SessionKeeper(MainApplicationServiceClient mainAppClient, IBrowserWindowsManager browserWindowsManager, IBrowserWindowsBuilder <IBrowserWindow> browserWindowsBuilder, ILogger log, IUiHelper uiHelper) { if (mainAppClient == null) { throw new ArgumentNullException("mainAppClient"); } if (browserWindowsManager == null) { throw new ArgumentNullException("browserWindowsManager"); } if (browserWindowsBuilder == null) { throw new ArgumentNullException("browserWindowsBuilder"); } if (log == null) { throw new ArgumentNullException("log"); } if (uiHelper == null) { throw new ArgumentNullException("uiHelper"); } _mainAppClient = mainAppClient; _log = log; _uiHelper = uiHelper; _sessionUpdator = KeepUpdatingSession; _browserWindowsManager = browserWindowsManager; _browserWindowsBuilder = browserWindowsBuilder; _updaterThread = new Thread(_sessionUpdator); }
public void Init() { _uiHelper = new TestUiHelper(); _analytics = Substitute.For<IAnalytics>(); _asyncAnalytics = new AsyncAnalytics(_analytics, _uiHelper); }
private void InitWithMocks() { _uiHelper = Substitute.For<IUiHelper>(); _analytics = Substitute.For<IAnalytics>(); _asyncAnalytics = new AsyncAnalytics(_analytics, _uiHelper); }
public void Init() { _uiHelper = new TestUiHelper(); _browserWindowsManager = Substitute.For <IBrowserWindowsManager>(); _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper); }
public AsyncAnalytics(IAnalytics analyticsImpl, IUiHelper uiHelper) { _analyticsImpl = analyticsImpl; _uiHelper = uiHelper; }
public void Init() { _uiHelper = new TestUiHelper(); _browserWindowsManager = Substitute.For<IBrowserWindowsManager>(); _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper); }
private TaskbarPanel CreateTaskbarPanel(MainViewModel mainViewModel, IUiHelper uiHelper) { try { var taskbarPanel = new TaskbarPanel(_mainWindowReadyLatch, new NLogLogger("TaskbarPanel"), mainViewModel, uiHelper); taskbarPanel.InitializeButtons(); return taskbarPanel; } catch (Exception ex) { _log.ErrorException("Failed to initialize taskbar module", ex); uiHelper.ShowMessage(ex.ToString()); uiHelper.IgnoreException(_instanceMutex.ReleaseMutex); _instanceMutex = null; Current.Shutdown(); Environment.Exit(0); } return null; }
public BrowserWindowsCommunicator(IServiceBuilder <IBrowsersManagerApi> serviceStarter, IUiHelper uiHelper, ILogger log) : base(serviceStarter, uiHelper, log) { }
public HomeViewModel(IConnectivityService connectivityService , IUiHelper uiHelper , INavigationService navigationService , ILogger logger) : base(connectivityService, uiHelper, navigationService, logger) { }
public MainApplicationServiceClient(IServiceBuilder <IMainApplication> serviceStarter, IUiHelper uiHelper, ILogger log) : base(serviceStarter, uiHelper, log) { }