public void SaveDisabledAfterSelectionChange() { var markers = GetTestMarkers(); ITodoSettingsView view = new MockTodoSettingsView(markers); var controller = new TodoSettingPresenter(view); view.SelectedIndex = 2; Assert.IsFalse(view.SaveEnabled); }
public void SaveEnabledAfterPriorityChange() { var markers = GetTestMarkers(); ITodoSettingsView view = new MockTodoSettingsView(markers); var controller = new TodoSettingPresenter(view); view.ActiveMarkerPriority = TodoPriority.High; Assert.IsTrue(view.SaveEnabled); }
public void SaveEnabledAfterTextChange() { var markers = GetTestMarkers(); ITodoSettingsView view = new MockTodoSettingsView(markers); var controller = new TodoSettingPresenter(view); view.ActiveMarkerText = "SomeNewText"; Assert.IsTrue(view.SaveEnabled); }
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); }
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); }
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); }
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); }