public async Task DeleteReturnsRedirectToMySurveys() { using (var controller = new SurveysController(new Mock <ISurveyStore>().Object, new Mock <ISurveyAnswerStore>().Object, new Mock <ISurveyAnswersSummaryStore>().Object, null, null)) { var result = await controller.Delete(string.Empty, string.Empty) as RedirectToRouteResult; Assert.AreEqual("Index", result.RouteValues["action"]); Assert.AreEqual(null, result.RouteValues["controller"]); } }
public async Task DeleteCallsDeleteSurveyAnswersSummariesStore() { var mockSurveyAnswersSummaryStore = new Mock <ISurveyAnswersSummaryStore>(); using (var controller = new SurveysController(new Mock <ISurveyStore>().Object, new Mock <ISurveyAnswerStore>().Object, mockSurveyAnswersSummaryStore.Object, null, null)) { await controller.Delete("tenant", "survey-slug"); } mockSurveyAnswersSummaryStore.Verify(r => r.DeleteSurveyAnswersSummaryAsync("tenant", "survey-slug"), Times.Once()); }
public async Task DeleteCallsDeleteSurveyByTenantAndSlugNameFromSurveyStore() { var mockSurveyStore = new Mock <ISurveyStore>(); using (var controller = new SurveysController(mockSurveyStore.Object, new Mock <ISurveyAnswerStore>().Object, new Mock <ISurveyAnswersSummaryStore>().Object, null, null)) { await controller.Delete("tenant", "survey-slug"); } mockSurveyStore.Verify( r => r.DeleteSurveyByTenantAndSlugNameAsync( It.Is <string>(t => "tenant" == t), It.Is <string>(s => "survey-slug" == s)), Times.Once()); }