public void Controller_Put_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.Put(e.Id, delta); result.Result.Should().BeOfType <BadRequestResult>(); }