コード例 #1
0
        public void Test4()
        {
            var cc     = new ContentsController();
            var output = cc.Index();

            Assert.NotNull(output);
        }
コード例 #2
0
        public void ReturnsListOfContents(ContentIndexViewModel contentList)
        {
            var fakeContentRepository = new Mock <IContentEditorRepository>();

            fakeContentRepository.Setup(x => x.ReadList()).Returns(contentList);
            var subject = new ContentsController(fakeContentRepository.Object);

            var actionResult = subject.Index();
            var resultModel  = ((actionResult as ViewResult).Model as ContentIndexViewModel);

            Assert.Equal(contentList.Contents.Count(), resultModel.Contents.Count());
        }