Esempio n. 1
0
        public void SaveCompletedSurveyOk()
        {
            // SETUP
            var mockDbA = new MockCompletedSurveyDbAccess();
            var service = new Surveys.BizLogic.CompletedSurveys.SaveCompletedSurveyAction(mockDbA);

            var completedQuestions = EfTestData.CreateCompletedQuestions();
            var caseNo             = 999;
            var name = "Completed Survey Test";

            // ATTEMPT
            var result = service.Action(new SaveCompletedSurveyDto(name, caseNo, completedQuestions));

            // VERIFY
            service.Errors.Any().ShouldEqual(false);
            mockDbA.AddedCompletedSurvey.CaseNumber.ShouldEqual(caseNo);
            mockDbA.AddedCompletedSurvey.Name.ShouldEqual(name);
            mockDbA.AddedCompletedSurvey.CompletedQuestions.Count().ShouldEqual(completedQuestions.Count);
        }