public async Task IsGetTodoStatusOk() { // Arrange var dbContext = DbContextMocker.GetTodoesDbContext("TodoApp"); var controller = new TodoesController(dbContext); // Act var response = await controller.GetTodoes(1); var value = (ObjectResult)response; //dbContext.Dispose(); // Assert Assert.True(value.StatusCode.Value == 200); }
public async Task IsCrearTodoOk() { // Arrange var dbContext = DbContextMocker.GetTodoesDbContext("TodoApp"); var controller = new TodoesController(dbContext); // Act TodoParameters todo = new TodoParameters(); todo.descripcion = "HOLA IsCrearTodo"; //Microsoft.AspNetCore.Http.IFormFile formFile; //formFile.CopyToAsync() todo.documento = null; todo.estatus = "PENDIENTE"; var response = await controller.PostTodoes(todo); var value = (ObjectResult)response; //dbContext.Dispose(); // Assert Assert.True(value.StatusCode.Value == 201); }