コード例 #1
0
        public TwiMLResult Create(
            [Bind(Include = "QuestionId,RecordingUrl,Digits,CallSid,From")]
            Answer answer)
        {
            _answersRepository.Create(answer);

            var nextQuestion = new QuestionFinder(_questionsRepository).FindNext(answer.QuestionId);
            return TwiML(nextQuestion != null ? new Response(nextQuestion).Build() : ExitResponse);
        }
コード例 #2
0
        public void QuestionFind_returns_null_question_if_is_unavailable()
        {
            var firstQuestion = new Question { Id = 1, SurveyId = 1 };

            var questionsRepository = new InMemoryQuestionsRepository();
            questionsRepository.Create(firstQuestion);

            var nextQuestion = new QuestionFinder(questionsRepository).FindNext(firstQuestion.Id);

            Assert.That(nextQuestion, Is.Null);
        }