상속: Microsoft.AspNetCore.Mvc.Controller
예제 #1
0
        public void DeleteOk()
        {
            var controller = new TodoController(new MemoryTodoRepository());

            controller.DeleteItem(1);    
            Assert.Equal(0, controller.GetAll().Count());
        }     
예제 #2
0
        public TodoController GetController(ITodoRepository repo)
        {
            var controller = new TodoController();
            controller.TodoItems = repo;

            return controller;
        }
예제 #3
0
        public void GetByIdOk()
        {
            var controller = new TodoController(new MemoryTodoRepository());

            var result = (Item)((ObjectResult)controller.GetById(1)).Value;

            Assert.Equal(1, result.Id);
            Assert.Equal("In Memory Task 1", result.Title);
            Assert.Equal(true, result.IsDone);
        }
예제 #4
0
 public void GetAllOk()
 {
     var controller = new TodoController(new MemoryTodoRepository());
     
     Assert.Equal(1, controller.GetAll().Count());
 }