public void PostTags() { var newEntity = _fixture.Build <TagModel>().Without(x => x.Id).Create(); int _maxEntityIdBeforeAdd = _entities.Max(a => a.Id); // Act var controller = new TagsController(_logger, _entityBL, _commonBL); var result = controller.PostTags(newEntity) as OkNegotiatedContentResult <JsonResponse>; // Assert Assert.That(result.Content.Data, Is.EqualTo(_entities.Last())); Assert.That(_maxEntityIdBeforeAdd + 1, Is.EqualTo(_entities.Last().Id)); }