public void GetDescriptionOfNews_RequestOfView_ReturnedViewGetDescription() { int?topicId = 1; var mock = new Mock <IMainService <TopicDTO> >(); mock.Setup(a => a.GetElement(topicId.Value)).Returns(new TopicDTO()); var controller = new BlogController(mock.Object); var result = controller.GetDescriptionOfNews(topicId.Value) as ViewResult; Assert.AreEqual("News", result.ViewName); }
public void GetDescriptionOfNews_RequestOfView_ViewIsNotNull() { int?topicId = 1; var mock = new Mock <IMainService <TopicDTO> >(); mock.Setup(a => a.GetElement(topicId.Value)).Returns(new TopicDTO()); var controller = new BlogController(mock.Object); var result = controller.GetDescriptionOfNews(topicId.Value) as ViewResult; Assert.IsNotNull(result); }