Beispiel #1
0
        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());
        }
Beispiel #2
0
        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));
        }