public void Index_ReturnMarketDetail() { //Arrange var id = 5; var mocqRepo = new Mock <IRepository <MonsterTO> >(); mocqRepo.Setup(x => x.GetById(It.IsAny <int>())).Returns(testHelper.testMonster(id)); var author = new AuthorUseCase(mocqRepo.Object); var controller = new MarketController(author); // Act var actionResult = controller.Details(id) as ViewResult; var data = actionResult.Model as MonsterTO; //Assert Assert.AreEqual(typeof(MonsterTO), actionResult.Model.GetType()); Assert.AreEqual(id, data.Id); }