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)); }
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)); }
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); }