public void Update_AddNonExistentTaskOnUpdateTest() { TestHelper.ClearDatabase(options); TaskNote task = new TaskNote { Name = "1t" }; TaskTreeManager manager = new TaskTreeManager(options); manager.Update(task); Assert.NotNull(manager.Find(task.Id)); }
public void Update_UpdateTest() { TestHelper.ClearDatabase(options); TaskNote task = new TaskNote { Name = "1t" }; TaskTreeManager manager = new TaskTreeManager(options); manager.Add(task); task.Name = "1t_updated"; manager.Update(task); Assert.Equal(task.Name, manager.Find(task.Id).Name); }
public void Remove_RemoveTerminalTaskTest() { TestHelper.ClearDatabase(options); TaskNote[] tasks = { new TaskNote { Name = "1" }, new TaskNote { Name = "2" } }; TaskTreeManager manager = new TaskTreeManager(options); manager.Add(tasks[0]); manager.Add(tasks[1], tasks[0]); manager.Remove(tasks[1].Id); Assert.Null(manager.Find(tasks[1].Id)); Assert.Empty(manager.GetDescendants(tasks[0].Id)); }