예제 #1
0
        public void Test_GetTasks_RetrieveAllTasksWithCategory()
        {
            //Arrange
            Category testCategory = new Category("Everyday chores");

            testCategory.Save();

            DateTime myDate    = new DateTime(1999, 6, 4);
            Task     firstTask = new Task("Mow the lawn", testCategory.GetId(), myDate);

            firstTask.Save();

            Task secondTask = new Task("Do the Dishes", testCategory.GetId(), myDate);

            secondTask.Save();

            List <Task> testTaskList = new List <Task> {
                firstTask, secondTask
            };
            List <Task> result = testCategory.GetTask();

            Assert.Equal(testTaskList, result);
        }