public async Task delete_model_throw_not_found() { var db = BaseDbContextMock.GetDbContext(); var controller = new BaseControllerMock(db); var actionResult = await controller.DeleteItemAsync(8); Assert.IsType <NotFoundResult>(actionResult); }
public async Task delete_model() { var db = BaseDbContextMock.GetDbContext(); var controller = new BaseControllerMock(db); var actionResult = await controller.DeleteItemAsync(6); var ent = await db.Models.Where(x => x.Id == 6).FirstAsync(); Assert.IsType <OkResult>(actionResult); Assert.NotNull(ent.DeletedAt); }