public void FreeTimeAddedOnProjectCompletion() { var manager = new ProcessManager(); var expected = manager.FreeTimeDuration; manager.ProjectCompleted(); Assert.AreEqual(expected, manager.TotalFreeTime); }
public void AddIgnored_Test() { var manager = new ProcessManager(); var expected = new List<string> {"notepad++"}; manager.AddIgnored("notepad++"); var actual = manager.IgnoredApps; for (int i = 0; i < expected.Count; i++) { Assert.AreEqual(actual[i], expected[i]); } }
public void RemoveBlockedApp_Test() { var manager = new ProcessManager(); var expected = new List<string> {}; manager.BlockedApps.Add("notepad++.exe"); manager.RemoveBlockedApp("notepad++.exe"); var actual = manager.BlockedApps; for (int i = 0; i < expected.Count; i++) { Assert.AreEqual(actual[i], expected[i]); } }
public void CreateProject_Test() { var manager = new ProcessManager(); var title = "Capstone Tests"; var description = "working on some tests for capstone"; var due = new DateTime(2013, 3, 2); var expected = new List<Project> {new Project(title, description, due)}; manager.AddNewProject(title, description, due); var actual = manager.Projects; for (int i = 0; i < expected.Count; i++) { Assert.AreEqual(actual[i].Name, expected[i].Name); Assert.AreEqual(actual[i].DueDate, expected[i].DueDate); Assert.AreEqual(actual[i].Description, expected[i].Description); } }
private void InitializeWindow() { Manager = new ProcessManager(); Manager.BlockAppPrompt += ManagerOnBlockAppPrompt; Manager.BlockIgnored += ManagerBlockIgnored; Manager.GuiAddBlocked += GuiAddBlocked; Manager.FreeTimeOver += GuiWarnUser; var blocked = Manager.LoadBlacklist(); var ignored = Manager.LoadIgnoreList(); var projects = Manager.LoadProjects(); Manager.LoadHandlersIntoManager(); LoadPersistedToGui(blocked, ignored, projects); ComboBox(); Update(); UpdateSettingsText(); }
public void UserCanChangeCycleDuration() { var manager = new ProcessManager(); var expected = 60*60; // 1 hour manager.SetCycleDuration(60); var actual = manager.CycleDuration; Assert.AreEqual(expected, actual); }