public void ViewTextIsNotNullOrEmptyAfterControllerConstruction()
        {
            //arrange
            var markers = new List<ToDoMarker> {new ToDoMarker("Todo:", TodoPriority.Medium)};

            var view = new TodoListSettingsUserControl(markers, new Mock<GridViewSort<ToDoMarker>>("", false).Object);

            //assert
            Assert.AreEqual("Todo:", view.ActiveMarkerText);
        }
        public void SetActiveItemChangesViewSelectedIndex()
        {
            //arrange
            var markers = GetTestMarkers();

            var view = new TodoListSettingsUserControl(markers, new Mock<GridViewSort<ToDoMarker>>("", false).Object);

            //act
            view.SelectedIndex = 1;

            Assert.AreEqual(1, view.SelectedIndex);

        }
        public void ViewPriorityMatchesAfterSelectionChange()
        {
            var markers = new List<ToDoMarker>
            {
                new ToDoMarker("Todo:", TodoPriority.Medium),
                new ToDoMarker("Note:", TodoPriority.Low),
                new ToDoMarker("Bug:", TodoPriority.High)
            };

            var view = new TodoListSettingsUserControl(markers, new Mock<GridViewSort<ToDoMarker>>("", false).Object);

            //act
            view.SelectedIndex = 2;

            Assert.AreEqual(TodoPriority.High, view.ActiveMarkerPriority);
        }
Example #4
0
        private void LoadWindow()
        {
            _treeview = new ConfigurationTreeViewControl(_config);

            splitContainer1.Panel1.Controls.Clear();
            splitContainer1.Panel1.Controls.Add(_treeview);
            _treeview.Dock = DockStyle.Fill;

            _generalSettingsView = new GeneralSettingsControl(_config.UserSettings.LanguageSetting, _configService);

            var markers      = _config.UserSettings.ToDoListSettings.ToDoMarkers;
            var gridViewSort = new GridViewSort <ToDoMarker>("Priority", true);

            _todoView       = new TodoListSettingsUserControl(markers, gridViewSort);
            _todoController = new TodoSettingPresenter(_todoView, new AddMarkerForm());

            ActivateControl(_generalSettingsView);
        }
Example #5
0
        public SettingsDialog(IConfigurationService configService)
            : this()
        {
            _configService = configService;
            _config        = _configService.LoadConfiguration();
            _treeview      = new ConfigurationTreeViewControl(_config);

            this.splitContainer1.Panel1.Controls.Add(_treeview);
            _treeview.Dock = DockStyle.Fill;

            var markers = _config.UserSettings.ToDoListSettings.ToDoMarkers.ToList();

            _todoView = new TodoListSettingsUserControl(markers);

            ActivateControl(_todoView);
            _todoController = new TodoSettingPresenter(_todoView);

            RegisterEvents();
        }
        public void MarkerChangeSavedOnPriorityChanged()
        {
            var markers = GetTestMarkers();

            var view = new TodoListSettingsUserControl(markers, new Mock<GridViewSort<ToDoMarker>>("", false).Object);

            view.ActiveMarkerPriority = TodoPriority.High;

            Assert.AreEqual(view.ActiveMarkerPriority, view.TodoMarkers[0].Priority);
        }
        private void LoadWindow()
        {
            _treeview = new ConfigurationTreeViewControl(_config);

            splitContainer1.Panel1.Controls.Clear();
            splitContainer1.Panel1.Controls.Add(_treeview);
            _treeview.Dock = DockStyle.Fill;

            _generalSettingsView = new GeneralSettingsControl(_config.UserSettings.LanguageSetting, _configService);

            var markers = _config.UserSettings.ToDoListSettings.ToDoMarkers;
            var gridViewSort = new GridViewSort<ToDoMarker>("Priority", true);
            _todoView = new TodoListSettingsUserControl(markers, gridViewSort);
            _todoController = new TodoSettingPresenter(_todoView, new AddMarkerForm());

            ActivateControl(_generalSettingsView);
        }