AnswerRecived() public method

public AnswerRecived ( ChatMessage message ) : void
message QuizGameServer.ChatMessage
return void
        public void OnChatMessageReceived_OneQuestionandIncorrectAnswer_NotifyWrongAnswer()
        {
            QuestionItem questionItem1 = new QuestionItem { Question = "Name1", Answer = "Alex1" };
            StubChatApi chatapi = new StubChatApi();
            QuizComunicator comunicator = new QuizComunicator(chatapi);
            comunicator.PoseAQuestion(questionItem1);

            ChatMessage message = new ChatMessage { Username = "******", Message = "SOMETHING INCORRECT" };
            chatapi.AnswerRecived(message);

            Assert.AreEqual("Wrong Answer!", chatapi.LastMessage);
        }
        public void OnChatMessageReceived_OneQuestionandCorrectAnswer_QuestionAnswered()
        {
            QuestionItem questionItem1 = new QuestionItem { Question = "Name1", Answer = "Alex1" };
            StubChatApi chatapi = new StubChatApi();
            QuizComunicator comunicator = new QuizComunicator(chatapi);
            comunicator.PoseAQuestion(questionItem1);

            ChatMessage message = new ChatMessage {Username = "******", Message = "Alex1"};
            chatapi.AnswerRecived(message);

            Assert.IsTrue(comunicator.IsQuestionAnswered);
        }
Beispiel #3
0
        public void OnChatMessageReceived_OneQuestionandIncorrectAnswer_NotifyWrongAnswer()
        {
            QuestionItem questionItem1 = new QuestionItem {
                Question = "Name1", Answer = "Alex1"
            };
            StubChatApi     chatapi     = new StubChatApi();
            QuizComunicator comunicator = new QuizComunicator(chatapi);

            comunicator.PoseAQuestion(questionItem1);

            ChatMessage message = new ChatMessage {
                Username = "******", Message = "SOMETHING INCORRECT"
            };

            chatapi.AnswerRecived(message);

            Assert.AreEqual("Wrong Answer!", chatapi.LastMessage);
        }
Beispiel #4
0
        public void OnChatMessageReceived_OneQuestionandCorrectAnswer_QuestionAnswered()
        {
            QuestionItem questionItem1 = new QuestionItem {
                Question = "Name1", Answer = "Alex1"
            };
            StubChatApi     chatapi     = new StubChatApi();
            QuizComunicator comunicator = new QuizComunicator(chatapi);

            comunicator.PoseAQuestion(questionItem1);

            ChatMessage message = new ChatMessage {
                Username = "******", Message = "Alex1"
            };

            chatapi.AnswerRecived(message);

            Assert.IsTrue(comunicator.IsQuestionAnswered);
        }