Example #1
0
        public void Scenario1()
        {
            var firstChoicePlayer = session.SelectRandonPlayer();

            Assert.NotNull(firstChoicePlayer);

            SmsResponseMessage response;

            //player is invalid / not playing
            response = session.AddResponse("INVALID PLAYER", "INVALID RESPONSE");
            Assert.False(response.Success);

            //no answer is being answered
            response = session.AddResponse("1", "INVALID RESPONSE");
            Assert.False(response.Success);
            Assert.StartsWith("no answer to respond to", response.Body);

            var answer = session.SelectAnswer("LINQ", 2);

            Assert.True(session.IsAnswerInProgress());

            Assert.False(session.HasPlayerResponded("1", answer));
            response = session.AddResponse("1", "valid response");
            Assert.True(response.Success);
            Assert.StartsWith("your response has been accepted", response.Body);

            Assert.True(session.HasPlayerResponded("1", answer));
            response = session.AddResponse("1", "valid response");
            Assert.False(response.Success);
            Assert.StartsWith("you have already provided a response to this answer", response.Body);
        }