public void TestNext() { facade.Start(1); facade.Next(1); Assert.AreEqual(questions[1], facade.GetCurrentQuestion(1)); Assert.AreEqual(2, facade.GetCurrentQuestionIndex(1)); Assert.AreEqual(3, facade.GetTotalQuestions(1)); facade.Next(1); Assert.AreEqual(questions[2], facade.GetCurrentQuestion(1)); Assert.AreEqual(3, facade.GetCurrentQuestionIndex(1)); Assert.AreEqual(3, facade.GetTotalQuestions(1)); facade.Next(1); Assert.AreEqual(questions[2], facade.GetCurrentQuestion(1)); Assert.AreEqual(3, facade.GetCurrentQuestionIndex(1)); Assert.AreEqual(3, facade.GetTotalQuestions(1)); }
public void Next(int quizId) { log.Debug("Trigger next question: " + quizId); _quiz.Next(quizId); QuizQuestion currentQuestion = _quiz.GetCurrentQuestion(quizId); LiveQuizModelView question = MapQuizToViewModel(currentQuestion); Clients.All.setQuestion(quizId, JsonConvert.SerializeObject(question)); log.Debug("Broadcast question: " + JsonConvert.SerializeObject(question)); if (question != null) { string stats = _quiz.GetAnswerStatistic(question.QuestionID); Clients.All.setStats(quizId, stats); log.Debug("Broadcast answer statistic: " + stats); } }