public void DeleteCallsDeleteSurveyByTenantAndSlugNameFromSurveyStore()
        {
            var mockSurveyStore = new Mock<ISurveyStore>();

            using (var controller = new SurveysController(mockSurveyStore.Object, new Mock<ISurveyAnswerStore>().Object, new Mock<ISurveyAnswersSummaryStore>().Object, null, null, null))
            {
                controller.Delete("tenant", "survey-slug");
            }

            mockSurveyStore.Verify(
                r => r.DeleteSurveyByTenantAndSlugName(
                    It.Is<string>(t => "tenant" == t),
                    It.Is<string>(s => "survey-slug" == s)),
                Times.Once());
        }
        public void DeleteReturnsRedirectToMySurveys()
        {
            using (var controller = new SurveysController(new Mock<ISurveyStore>().Object, new Mock<ISurveyAnswerStore>().Object, new Mock<ISurveyAnswersSummaryStore>().Object, null, null, null))
            {
                var result = controller.Delete(string.Empty, string.Empty) as RedirectToRouteResult;

                Assert.AreEqual("Index", result.RouteValues["action"]);
                Assert.AreEqual(null, result.RouteValues["controller"]);
            }
        }
        public void DeleteCallsDeleteSurveyAnswersSummariesStore()
        {
            var mockSurveyAnswersSummaryStore = new Mock<ISurveyAnswersSummaryStore>();

            using (var controller = new SurveysController(new Mock<ISurveyStore>().Object, new Mock<ISurveyAnswerStore>().Object, mockSurveyAnswersSummaryStore.Object, null, null, null))
            {
                controller.Delete("tenant", "survey-slug");
            }

            mockSurveyAnswersSummaryStore.Verify(r => r.DeleteSurveyAnswersSummary("tenant", "survey-slug"), Times.Once());
        }