示例#1
0
        public ActionResult Create([Bind(Include = "QuestionId,RecordingUrl,Digits,CallSid,From")] Answer answer)
        {
            this._answersRepository.Create(answer);

            Question      nextQuestion = new QuestionFinder(this._questionsRepository).FindNext(answer.QuestionId);
            VoiceResponse response     = nextQuestion != null ? new Response(nextQuestion).Build() : ExitResponse;

            return(this.TwiML(response));
        }
示例#2
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));
        }
示例#3
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);
        }