public void ShowEventDetails()
        {
            var form      = new FormMainStub();
            var presenter = new FormMainPresenter(form, _ServiceGateway, _LogViewModel);

            form.ShowEvents();
            form.ShowEventDetails();

            Assert.IsTrue(presenter.LogViewPresenter.DetailsVisible);
        }
        public void RefreshEvents()
        {
            var logViewModelMock = new LogViewModelMock();

            _Form      = new FormMainStub();
            _Presenter = new FormMainPresenter(_Form, _ServiceGateway, logViewModelMock);

            _Form.RefreshEvents();

            Assert.IsTrue(logViewModelMock.IsRefreshed);
        }
        public void TestInitialize()
        {
            _Form             = new FormMainStub();
            _InterfaceManager = new ServiceInterfaceManagerStub();

            // Redirect all calls to AdvSCStub and ServiceInterfaceManagerStub to avoid creating accessing system resources.
            _ServiceGateway = new ServiceGateway(new AdvSCStub(), _InterfaceManager);

            _LogViewModel = new LogViewModelMock();
            _Presenter    = new FormMainPresenter(_Form, _ServiceGateway, _LogViewModel);

            _ServiceGateway.Start();
        }
        public void ShowEvents()
        {
            var logViewModelMock = new LogViewModelMock();

            _Form      = new FormMainStub();
            _Presenter = new FormMainPresenter(_Form, _ServiceGateway, logViewModelMock);

            _Form.ShowEvents();

            Assert.IsTrue(_Form.DisplayedControl is LogViewControl);
            Assert.IsTrue(((Control)_Form.DisplayedControl).Dock == DockStyle.Fill);
            Assert.AreSame(_Form.DisplayedControl, _Presenter.LogViewPresenter.LogView);

            AssertEventsRibbonVisible(true);
            Assert.IsTrue(logViewModelMock.IsRefreshed);
        }
Beispiel #5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string Path = Environment.CurrentDirectory;

            string[] appPath = Path.Split(new string[] { "bin" }, StringSplitOptions.None);
            AppDomain.CurrentDomain.SetData("DataDirectory", appPath[0]);


            var form    = new FormMain();
            var manager = new DBaseManager();

            var presenter = new FormMainPresenter(form);

            presenter.Show();
        }