public void FindByDoneStatusTest() { // People people = new People(); ToDoItems toDo = new ToDoItems(); PersonSequencer.Reset(); TodoSequencer.ResetID(); Person Jane = people.AddNewPerson(1, "Jane", "Doe"); ToDo item1 = toDo.AddNewToDoNew(1, "Win lotto", false, Jane); ToDo item2 = toDo.AddNewToDoNew(1, "Learn to code", true, Jane); //Act ToDo[] result = toDo.FindByDoneStatus(); //Assert Assert.Contains(item2, result); //Jane has learned to code Assert.DoesNotContain(item1, result); //Jane has not yet won the lotto }
//xczx public ToDo[] FindUnassignedTodoItems() { //Arrange People people = new People(); ToDoItems toDo = new ToDoItems(); PersonSequencer.Reset(); TodoSequencer.ResetID(); Person Jane = people.AddNewPerson(1, "Jane", "Doe"); Person John = people.AddNewPerson(2, "John", "Doe"); ToDo item1 = toDo.AddNewToDoNew(1, "Win lotto", false, Jane); ToDo item2 = toDo.AddNewToDoNew(2, "Learn to code", true, John); ToDo itemNotDone1 = toDo.AddNewToDoNew(3, "Yet to be assigned", false); //Act ToDo[] result = toDo.FindUnassignedTodo(); //Assert Assert.Contains(itemNotDone1, result); Assert.DoesNotContain(item1, result); }
public void FindByLastnameTest() { //Arrange People people = new People(); ToDoItems toDo = new ToDoItems(); PersonSequencer.Reset(); TodoSequencer.ResetID(); Person Doe = people.AddNewPerson(1, "Jane", "Doe"); Person Smith = people.AddNewPerson(2, "John", "Smith"); ToDo item1 = toDo.AddNewToDoNew(1, "Win lotto", false, Doe); ToDo item2 = toDo.AddNewToDoNew(2, "Learn to code", false, Smith); //Act ToDo[] result = toDo.FindByLastname(Doe); ToDo[] result2 = toDo.FindByLastname(Smith); //Assert Assert.Contains(item1, result); Assert.Contains(item2, result2); }
public void FindByAssigneeTest() { //Arrange People people = new People(); ToDoItems toDo = new ToDoItems(); PersonSequencer.Reset(); TodoSequencer.ResetID(); Person Jane = people.AddNewPerson(1, "Jane", "Doe"); Person John = people.AddNewPerson(2, "John", "Doe"); ToDo item1 = toDo.AddNewToDoNew(1, "Win lotto", false, Jane); ToDo item2 = toDo.AddNewToDoNew(2, "Learn to code", true, John); //Act ToDo[] result = toDo.FindByAssignee(1); ToDo[] result2 = toDo.FindByAssignee(2); //Assert Assert.Contains(item1, result); Assert.Contains(item2, result2); }