예제 #1
0
        public void SaveDisabledAfterSelectionChange()
        {
            var markers = GetTestMarkers();

            ITodoSettingsView view = new MockTodoSettingsView(markers);
            var controller         = new TodoSettingPresenter(view);

            view.SelectedIndex = 2;

            Assert.IsFalse(view.SaveEnabled);
        }
예제 #2
0
        public void SaveEnabledAfterPriorityChange()
        {
            var markers = GetTestMarkers();

            ITodoSettingsView view = new MockTodoSettingsView(markers);
            var controller         = new TodoSettingPresenter(view);

            view.ActiveMarkerPriority = TodoPriority.High;

            Assert.IsTrue(view.SaveEnabled);
        }
예제 #3
0
        public void SaveEnabledAfterTextChange()
        {
            var markers = GetTestMarkers();

            ITodoSettingsView view = new MockTodoSettingsView(markers);
            var controller         = new TodoSettingPresenter(view);

            view.ActiveMarkerText = "SomeNewText";

            Assert.IsTrue(view.SaveEnabled);
        }
예제 #4
0
        public void SetActiveItemChangesActiveMarker()
        {
            //arrange
            var markers = GetTestMarkers();

            ITodoSettingsView view = new MockTodoSettingsView(markers);

            var controller = new TodoSettingPresenter(view);

            //act
            controller.SetActiveItem(1);

            Assert.AreEqual(markers[1], controller.ActiveMarker);
        }
예제 #5
0
        public void SetActiveItemChangesViewSelectedIndex()
        {
            //arrange
            var markers = GetTestMarkers();

            ITodoSettingsView view = new MockTodoSettingsView(markers);

            var controller = new TodoSettingPresenter(view);

            //act
            controller.SetActiveItem(1);

            Assert.AreEqual(1, view.SelectedIndex);
        }
예제 #6
0
        public void ViewTextIsNotNullOrEmptyAfterControllerConstruction()
        {
            //arrange
            var markers = new List <ToDoMarker>();

            markers.Add(new ToDoMarker("Todo:", TodoPriority.Normal));

            ITodoSettingsView view = new MockTodoSettingsView(markers);

            //act
            var controller = new TodoSettingPresenter(view);

            //assert
            Assert.AreEqual("Todo:", view.ActiveMarkerText);
        }
예제 #7
0
        public void ViewTextMatchesAfterSelectionChange()
        {
            var markers = new List <ToDoMarker>();

            markers.Add(new ToDoMarker("Todo:", TodoPriority.Normal));
            markers.Add(new ToDoMarker("Note:", TodoPriority.Low));

            ITodoSettingsView view = new MockTodoSettingsView(markers);
            var controller         = new TodoSettingPresenter(view);

            //act
            controller.SetActiveItem(1);

            Assert.AreEqual("Note:", view.ActiveMarkerText);
        }