/// <summary>
        /// Called when the view is fully constructed but not yet on display.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                Localise.Form(this);

                _Presenter = Factory.Singleton.Resolve <IConnectionClientLogPresenter>();
                _Presenter.Initialise(this);

                _OnlineHelp = new OnlineHelpHelper(this, OnlineHelpAddress.WinFormsConnectionClientLogDialog);
            }
        }
        public void TestInitialise()
        {
            _ClassFactorySnapshot = Factory.TakeSnapshot();

            _Clock = new ClockMock();
            Factory.Singleton.RegisterInstance <IClock>(_Clock.Object);

            _LogClients  = new List <LogClient>();
            _LogSessions = new Dictionary <long, IList <LogSession> >();
            _LogDatabase = TestUtilities.CreateMockSingleton <ILogDatabase>();
            _LogDatabase.Setup(d => d.FetchAll(It.IsAny <IList <LogClient> >(), It.IsAny <IDictionary <long, IList <LogSession> > >())).Callback((IList <LogClient> clients, IDictionary <long, IList <LogSession> > sessions) => {
                foreach (var client in _LogClients)
                {
                    clients.Add(client);
                }
                foreach (var kvpSession in _LogSessions)
                {
                    sessions.Add(kvpSession.Key, kvpSession.Value);
                }
            });

            _Log = TestUtilities.CreateMockSingleton <ILog>();

            _Presenter = Factory.Singleton.Resolve <IConnectionClientLogPresenter>();

            _Provider = new Mock <IConnectionClientLogPresenterProvider>()
            {
                DefaultValue = DefaultValue.Mock
            }.SetupAllProperties();
            _Provider.Setup(p => p.InvokeOnBackgroundThread(It.IsAny <Action <IList <LogClient> > >(), It.IsAny <IList <LogClient> >())).Callback((Action <IList <LogClient> > callback, IList <LogClient> clients) => {
                callback(clients);
            });
            _Presenter.Provider = _Provider.Object;

            _View = new Mock <IConnectionClientLogView>()
            {
                DefaultValue = DefaultValue.Mock
            }.SetupAllProperties();
        }
        public void TestInitialise()
        {
            _ClassFactorySnapshot = Factory.TakeSnapshot();

            _LogClients = new List<LogClient>();
            _LogSessions = new Dictionary<long, IList<LogSession>>();
            _LogDatabase = TestUtilities.CreateMockSingleton<ILogDatabase>();
            _LogDatabase.Setup(d => d.FetchAll(It.IsAny<IList<LogClient>>(), It.IsAny<IDictionary<long, IList<LogSession>>>())).Callback((IList<LogClient> clients, IDictionary<long, IList<LogSession>> sessions) => {
                foreach(var client in _LogClients) clients.Add(client);
                foreach(var kvpSession in _LogSessions) sessions.Add(kvpSession.Key, kvpSession.Value);
            });

            _Log = TestUtilities.CreateMockSingleton<ILog>();

            _Presenter = Factory.Singleton.Resolve<IConnectionClientLogPresenter>();

            _Provider = new Mock<IConnectionClientLogPresenterProvider>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties();
            _Provider.Setup(p => p.InvokeOnBackgroundThread(It.IsAny<Action<IList<LogClient>>>(), It.IsAny<IList<LogClient>>())).Callback((Action<IList<LogClient>> callback, IList<LogClient> clients) => {
                callback(clients);
            });
            _Presenter.Provider = _Provider.Object;

            _View = new Mock<IConnectionClientLogView>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties();
        }
        /// <summary>
        /// Called when the view is fully constructed but not yet on display.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if(!DesignMode) {
                Localise.Form(this);

                _Presenter = Factory.Singleton.Resolve<IConnectionClientLogPresenter>();
                _Presenter.Initialise(this);

                _OnlineHelp = new OnlineHelpHelper(this, OnlineHelpAddress.WinFormsConnectionClientLogDialog);
            }
        }