public void ShouldRenderDetailViewCorrectly() { Mock <IGenericService <Goal> > goalServiceMock = new Mock <IGenericService <Goal> >(); Goal goal = new Goal() { Id = 100, Bloom = "Understand", Description = @"Je begrijpt de basismechanismen voor access control, zodanig dat je in eigen woorden kunt uitleggen wat de betekenis is in de context van software security. " }; goalServiceMock.Setup(m => m.FindById(It.IsAny <int>(), It.IsAny <string[]>())).Returns(goal); GoalController controller = new GoalController(goalServiceMock.Object); Goal model = (controller.Details(goal.Id) as ViewResult)?.ViewData.Model as Goal; Assert.Equal(100, model.Id); Assert.Equal("Understand", model.Bloom); }