示例#1
0
        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);
        }
示例#2
0
        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);
        }