Ejemplo n.º 1
0
        public void Redirect_To_The_List_When_Valid_Task_Is_Posted()
        {
            // Arrange
            TasksController controller = new TasksController(new FakeTasksRepository());

            // Act
            JsonResult result = controller.Edit(new Task {ID = 1, Description = "Changed Description"}) as JsonResult;

            // Assert
            Assert.IsTrue((bool)result.Data);
        }
Ejemplo n.º 2
0
        public void Display_Get_The_Correct_Task_From_The_Repository()
        {
            // Arrange
            TasksController controller = new TasksController(repository.Object);

            // Act
            ViewResult result = controller.Edit(1) as ViewResult;
            EditTaskViewModel model = result.Model as EditTaskViewModel;

            // Assert
            Assert.IsNotNull(model);
            Assert.AreEqual(1, model.Task.ID);
        }