public void WhenPostingATopic_ThenMapAndSaveChanges() { var topic = new Topic { Name = "Topic 1", Description = "Foo", GroupId = SampleGroup.Id.Value }; var entityById = Mock.Of<IEntityById>(e => e.Get<Topic>(It.IsAny<Identity>()) == topic); var topicsController = CreateController(entityById: entityById); topicsController.Edit(new EditTopicModel {Description = "Desc", Name = "Tap"}); topic.Satisfy(t => t.Description == "Desc" && t.Name == "Tap"); }