public void InitializeTasks_NullTaskList_Throws() { using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { Assert.Throws <ArgumentNullException>(() => tabbedForm.InitializeTasks(null)); } }
public void SetActiveTask_Null_Throws() { using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); Assert.Throws <ArgumentNullException>(() => tabbedForm.SetActiveTask(null)); } }
public void GetCurrentWorkTask_NoTasks_IsNull() { _project.Tasks.Clear(); using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); Assert.IsNull(tabbedForm.CurrentWorkTask); } }
public void SetActiveTask_TaskIsPinned_CurrentWorkTaskNoChange() { using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); ITask initialWorkTask = tabbedForm.CurrentWorkTask; tabbedForm.SetActiveTask(_project.Tasks[0]); Assert.AreSame(initialWorkTask, tabbedForm.CurrentWorkTask); } }
public void GetCurrentWorkTask_RegularSetOfTasks_IsFirstNonPinned() { ClearCurrentWorkTask(); using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); Assert.IsNotNull(tabbedForm.CurrentWorkTask); Assert.AreEqual("Add Meanings", tabbedForm.CurrentWorkTask.Label); } }
public void ActiveTask_RegularSetOfTasks_IsFirstTask() { using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); Assert.IsTrue(((MockTask)_project.Tasks[0]).IsActive); Assert.IsFalse(((MockTask)_project.Tasks[1]).IsActive); Assert.IsFalse(((MockTask)_project.Tasks[2]).IsActive); Assert.IsFalse(((MockTask)_project.Tasks[3]).IsActive); } }
public void GetCurrentWorkTask_OnlyPinnedTasks_IsNull() { _project.Tasks.Clear(); _project.Tasks.Add(new MockTask("Dashboard", "The control center.", true)); _project.Tasks.Add(new MockTask("Words", "The whole lexicon.", true)); using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); Assert.IsNull(tabbedForm.CurrentWorkTask); } }
public void SetActiveTask_ToPinnedTask_AnotherTaskActivated_DeactivateOtherAndActivateNew() { using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { EnsureCreated(tabbedForm); tabbedForm.InitializeTasks(_project.Tasks); Assert.IsTrue(((MockTask)_project.Tasks[0]).IsActive, "1"); tabbedForm.SetActiveTask(_project.Tasks[1]); Assert.IsFalse(((MockTask)_project.Tasks[0]).IsActive, "2"); Assert.IsTrue(((MockTask)_project.Tasks[1]).IsActive, "3"); } }
public void GetCurrentWorkTask_RemembersLastCurrentWorkTask() { using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); tabbedForm.SetActiveTask(_project.Tasks[3]); } using (var x = new TabbedForm(new NullStatusBarController())) { x.InitializeTasks(_project.Tasks); Assert.AreEqual("Semantic Domains", x.CurrentWorkTask.Label); } }
public void ActiveTask_OnlyPinnedTasks_IsFirstTask() { _project.Tasks.Clear(); _project.Tasks.Add(new MockTask("Dashboard", "The control center.", true)); _project.Tasks.Add(new MockTask("Words", "The whole lexicon.", true)); using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); Assert.IsTrue(((MockTask)_project.Tasks[0]).IsActive); Assert.IsFalse(((MockTask)_project.Tasks[1]).IsActive); } }
public void SetActiveTask_ToWorkTask_AnotherWorkTaskActivated_DeactivateOtherAndActivateNew() { using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { tabbedForm.InitializeTasks(_project.Tasks); tabbedForm.SetActiveTask(_project.Tasks[2]); tabbedForm.SetActiveTask(_project.Tasks[3]); Assert.IsTrue(((MockTask)_project.Tasks[3]).IsActive); Assert.IsFalse(((MockTask)_project.Tasks[2]).IsActive); Assert.AreEqual(_project.Tasks[3].Label, tabbedForm.TabLabels[2]); } }
SetActiveTask_ToWorkTask_AnotherTaskActivated_DeactivateOtherAndActivateNew_ChangeLabel () { using (TabbedForm tabbedForm = new TabbedForm(new NullStatusBarController())) { EnsureCreated(tabbedForm); tabbedForm.InitializeTasks(_project.Tasks); Assert.IsTrue(((MockTask)_project.Tasks[0]).IsActive, "1"); tabbedForm.SetActiveTask(_project.Tasks[3]); Assert.IsFalse(((MockTask)_project.Tasks[0]).IsActive, "2"); Assert.IsTrue(((MockTask)_project.Tasks[3]).IsActive, "3"); Assert.AreEqual(_project.Tasks[3].Label, tabbedForm.TabLabels[2], "4"); } }
public void Setup() { string entriesXml = @"<entry id='foo1'><lexical-unit><form lang='v'><text>fooOne</text></form></lexical-unit></entry> <entry id='foo2'><lexical-unit><form lang='v'><text>fooTwo</text></form></lexical-unit></entry> <entry id='foo3'><lexical-unit><form lang='v'><text>fooThree</text></form></lexical-unit></entry>"; _projectDirectory = new ProjectDirectorySetupForTesting(entriesXml); _project = new WeSayWordsProject(); _project.LoadFromLiftLexiconPath(_projectDirectory.PathToLiftFile); _tabbedForm = new TabbedForm(); _project.Tasks = new List<ITask>(); _dashboardTask = new MockTask("Dashboard", "The control center.", true); _project.Tasks.Add(_dashboardTask); _dictionaryTask = new MockTask("Dictionary blah blah", "The whole lexicon.", true); _project.Tasks.Add(_dictionaryTask); _tabbedForm.InitializeTasks(_project.Tasks); }
public void Setup() { string entriesXml = @"<entry id='foo1'><lexical-unit><form lang='qaa-x-qaa'><text>fooOne</text></form></lexical-unit></entry> <entry id='foo2'><lexical-unit><form lang='qaa-x-qaa'><text>fooTwo</text></form></lexical-unit></entry> <entry id='foo3'><lexical-unit><form lang='qaa-x-qaa'><text>fooThree</text></form></lexical-unit></entry>" ; _projectDirectory = new ProjectDirectorySetupForTesting(entriesXml); _project = new WeSayWordsProject(); _project.LoadFromLiftLexiconPath(_projectDirectory.PathToLiftFile); _tabbedForm = new TabbedForm(new NullStatusBarController()); _project.Tasks = new List <ITask>(); _dashboardTask = new MockTask("Dashboard", "The control center.", true); _project.Tasks.Add(_dashboardTask); _dictionaryTask = new MockDictionaryTask("Dictionary blah blah", "The whole lexicon.", true); _project.Tasks.Add(_dictionaryTask); _tabbedForm.InitializeTasks(_project.Tasks); }
public void SetActiveTask_ToWorkTask_AnotherWorkTaskActivated_DeactivateOtherAndActivateNew() { TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); tabbedForm.ActiveTask = _project.Tasks[2]; tabbedForm.ActiveTask = _project.Tasks[3]; Assert.IsTrue(((MockTask) _project.Tasks[3]).IsActive); Assert.IsFalse(((MockTask) _project.Tasks[2]).IsActive); Assert.AreEqual(_project.Tasks[3].Label, tabbedForm.TabLabels[2]); }
public void SetActiveTask_ToPinnedTask_AnotherTaskActivated_DeactivateOtherAndActivateNew() { TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); Assert.IsTrue(((MockTask) _project.Tasks[0]).IsActive); tabbedForm.ActiveTask = _project.Tasks[1]; Assert.IsFalse(((MockTask) _project.Tasks[0]).IsActive); Assert.IsTrue(((MockTask) _project.Tasks[1]).IsActive); }
public void SetActiveTask_TaskIsPinned_CurrentWorkTaskNoChange() { TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); ITask initialWorkTask = tabbedForm.CurrentWorkTask; tabbedForm.ActiveTask = _project.Tasks[0]; Assert.AreSame(initialWorkTask, tabbedForm.CurrentWorkTask); }
public void SetActiveTask_Null_Throws() { TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); tabbedForm.ActiveTask = null; }
public void ActiveTask_RegularSetOfTasks_IsFirstTask() { TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); Assert.IsTrue(((MockTask) _project.Tasks[0]).IsActive); Assert.IsFalse(((MockTask) _project.Tasks[1]).IsActive); Assert.IsFalse(((MockTask) _project.Tasks[2]).IsActive); Assert.IsFalse(((MockTask) _project.Tasks[3]).IsActive); }
public void GetCurrentWorkTask_RemembersLastCurrentWorkTask() { TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); tabbedForm.ActiveTask = _project.Tasks[3]; tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); Assert.AreEqual("Semantic Domains", tabbedForm.CurrentWorkTask.Label); }
public void GetCurrentWorkTask_RegularSetOfTasks_IsFirstNonPinned() { ClearCurrentWorkTask(); TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); Assert.IsNotNull(tabbedForm.CurrentWorkTask); Assert.AreEqual("Add Meanings", tabbedForm.CurrentWorkTask.Label); }
public void ActiveTask_OnlyPinnedTasks_IsFirstTask() { _project.Tasks.Clear(); _project.Tasks.Add(new MockTask("Dashboard", "The control center.", true)); _project.Tasks.Add(new MockTask("Words", "The whole lexicon.", true)); TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); Assert.IsTrue(((MockTask) _project.Tasks[0]).IsActive); Assert.IsFalse(((MockTask) _project.Tasks[1]).IsActive); }
public void GetCurrentWorkTask_OnlyPinnedTasks_IsNull() { _project.Tasks.Clear(); _project.Tasks.Add(new MockTask("Dashboard", "The control center.", true)); _project.Tasks.Add(new MockTask("Words", "The whole lexicon.", true)); TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); Assert.IsNull(tabbedForm.CurrentWorkTask); }
public void GetCurrentWorkTask_NoTasks_IsNull() { _project.Tasks.Clear(); TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(_project.Tasks); Assert.IsNull(tabbedForm.CurrentWorkTask); }
public void InitializeTasks_NullTaskList_Throws() { TabbedForm tabbedForm = new TabbedForm(); tabbedForm.InitializeTasks(null); }