Exemplo n.º 1
0
        public void GetTasksNotifications_TwoResults()
        {
            FakeContext       mock = new FakeContext();
            FakeUserInterface fakeUserInterface = new FakeUserInterface();
            TaskControl       ctrl = new TaskControl(mock, fakeUserInterface);
            ToDoTask          obj  = new ToDoTask();

            obj.Name = "test";
            obj.Date = DateTime.Now.AddDays(5);
            ToDoTask secondObj = new ToDoTask();

            secondObj.Name = "test2";
            secondObj.Date = DateTime.Now.AddDays(7);
            ToDoTask ThirthObj = new ToDoTask();

            ThirthObj.Name = "test3";
            ThirthObj.Date = DateTime.Now.AddDays(3);

            ctrl.AddAsync(obj).Wait();
            ctrl.AddAsync(secondObj).Wait();
            ctrl.AddAsync(ThirthObj).Wait();
            List <ToDoTask> result = ctrl.GetNotifications(5).Result.ToList();

            Assert.AreEqual(2, result.Count, "Count elements of lists are different");
        }