Ejemplo 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 dueDateEquality     = this.GetDueDate() == newTask.GetDueDate();
         bool doneEquality        = this.GetDone() == newTask.GetDone();
         return(idEquality && descriptionEquality && dueDateEquality);
     }
 }
Ejemplo n.º 2
0
        public void Test_Done_DoneIsSetToTrueOrFalse()
        {
            //Arrange
            int      result       = 1;
            Category testCategory = new Category("Home stuff");

            testCategory.Save();

            Task testTask = new Task("mow the lawn", "2017-02-17");

            testTask.Save();

            //Act
            testTask.SetDone(1);

            //Assert
            Assert.Equal(result, testTask.GetDone());
        }