public void Controller_Get_Should_Be_NoContentResult()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportStatesController> >().Object;
            var repository = new ReportStateRepository(fixture.context);
            var controller = new ReportStatesController(logger, repository);
            ActionResult <IQueryable <ReportState> > result = controller.Get();

            result.Result.Should().BeOfType <NoContentResult>();
        }
        public void Controller_Post_Should_Be_OkResult()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportStatesController> >().Object;
            var repository = new ReportStateRepository(fixture.context);
            var controller = new ReportStatesController(logger, repository);
            var e          = ReportStateEntityTypeConfiguration.ReportStateSeed.ElementAt(0);
            ActionResult <ReportState> result = controller.Post(e);

            result.Result.Should().BeOfType <OkObjectResult>();
        }
        public void Controller_Get_ById_Should_Be_NoContentResult()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportStatesController> >().Object;
            var repository = new ReportStateRepository(fixture.context);
            var controller = new ReportStatesController(logger, repository);
            var e          = ReportStateEntityTypeConfiguration.ReportStateSeed.First().Id;
            ActionResult <ReportState> result = controller.Get(e);

            result.Result.Should().BeOfType <NoContentResult>();
        }
        public void Controller_Delete_Should_Be_NotFound()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportStatesController> >().Object;
            var repository = new ReportStateRepository(fixture.context);
            var controller = new ReportStatesController(logger, repository);
            var eid        = ReportStateEntityTypeConfiguration.ReportStateSeed.ElementAt(1).Id;
            ActionResult <ReportState> result = controller.Delete(eid);

            result.Result.Should().BeOfType <NotFoundResult>();
        }
        public void Controller_Patch_Should_Be_BadRequest()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportStatesController> >().Object;
            var repository = new ReportStateRepository(fixture.context);
            var controller = new ReportStatesController(logger, repository);
            var e          = ReportStateEntityTypeConfiguration.ReportStateSeed.ElementAt(1);
            var delta      = new Delta <ReportState>(typeof(ReportState));

            delta.TrySetPropertyValue(nameof(ReportState.Name), e.Name as object);
            ActionResult <ReportState> result = controller.Patch(e.Id, delta);

            result.Result.Should().BeOfType <BadRequestResult>();
        }