public async Task DeleteNotFound() { var sut = new GizmosController(_ctx); var maxId = _ctx.Gizmos.Max(x => x.Id); var actual = await sut.Delete(maxId + 1); Assert.Equal(typeof(NotFoundResult), actual.GetType()); }
public async Task Delete() { var sut = new GizmosController(_ctx); var gizmo = _ctx.Gizmos.Last(); var actual = await sut.Delete(gizmo.Id); Assert.Equal(typeof(NoContentResult), actual.GetType()); Assert.Null(_ctx.Gizmos.SingleOrDefault(x => x.Id == gizmo.Id)); }