public void IndexReturnsRecentSurveysFromStoreInTheModel()
        {
            var mockSurveyStore = new Mock<ISurveyStore>();
            var surveys = new List<Survey>();
            mockSurveyStore.Setup(r => r.GetRecentSurveys()).Returns(surveys);

            using (var controller = new SurveysController(mockSurveyStore.Object, default(ISurveyAnswerStore)))
            {
                var result = controller.Index() as ViewResult;

                var model = result.ViewData.Model as TenantPageViewData<IEnumerable<Survey>>;
                Assert.AreSame(surveys, model.ContentModel);
            }
        }
        public void IndexReturnsTitleInTheModel()
        {
            var mockSurveyStore = new Mock<ISurveyStore>();

            using (var controller = new SurveysController(mockSurveyStore.Object, default(ISurveyAnswerStore)))
            {
                var result = controller.Index() as ViewResult;

                var model = result.ViewData.Model as TenantMasterPageViewData;
                Assert.AreEqual("Existing surveys", model.Title);
            }
        }
        public void IndexGetsRecentSurveysFromStore()
        {
            var mockSurveyStore = new Mock<ISurveyStore>();

            using (var controller = new SurveysController(mockSurveyStore.Object, default(ISurveyAnswerStore)))
            {
                controller.Index();
            }

            mockSurveyStore.Verify(r => r.GetRecentSurveys(), Times.Once());
        }