Exemplo n.º 1
0
 public override bool Equals(System.Object otherTask)
 {
     if (!(otherTask is Task))
     {
         return(false);
     }
     else
     {
         Task newTask             = (Task)otherTask;
         bool idEquality          = this.GetId() == newTask.GetId();
         bool descriptionEquality = this.GetDescription() == newTask.GetDescription();
         bool completeEquality    = this.GetComplete() == newTask.GetComplete();
         return(idEquality && descriptionEquality && completeEquality);
     }
 }
Exemplo n.º 2
0
        public void Task_GetComplete_ReturnAListOfTasks()
        {
            //Arrange
            Task testTask = new Task("Mow the lawn", "1999-01-01");

            testTask.Save();
            Task testTask2 = new Task("Bridge the Gap", "2000-01-01");

            testTask2.Save();

            //Act
            testTask.ToggleComplete();
            testTask.ToggleComplete();
            testTask2.ToggleComplete();

            //Assert
            Assert.Equal(1, Task.GetComplete(false).Count);
        }