Exemplo n.º 1
0
        public async void Can_change_security_question()
        {
            var player        = FakePlayerRepository.Players.Single();
            var newQuestionId = TestDataGenerator.GetRandomSecurityQuestion();
            var newAnswer     = "SecurityAnswer" + TestDataGenerator.GetRandomString();
            await PlayerWebservice.ChangeSecurityQuestionAsync(new ChangeSecurityQuestionRequest
            {
                Id = player.Id.ToString(),
                SecurityQuestionId = newQuestionId,
                SecurityAnswer     = newAnswer,
            });

            Assert.AreEqual(newQuestionId, player.SecurityQuestionId.ToString());
            Assert.AreEqual(newAnswer, player.SecurityAnswer);
        }
Exemplo n.º 2
0
        public void Cannt_change_security_question_with_invalid_player()
        {
            var playerId      = new Guid().ToString();
            var newQuestionId = TestDataGenerator.GetRandomSecurityQuestion();
            var newAnswer     = "SecurityAnswer" + TestDataGenerator.GetRandomString();
            var e             = Assert.Throws <MemberApiValidationException>(async() => await PlayerWebservice.ChangeSecurityQuestionAsync(new ChangeSecurityQuestionRequest
            {
                Id = playerId,
                SecurityQuestionId = newQuestionId,
                SecurityAnswer     = newAnswer,
            }));

            Assert.AreEqual(PlayerAccountResponseCode.PlayerDoesNotExist.ToString(), e.Message);
        }
Exemplo n.º 3
0
        public void Cannt_change_security_question_with_blank_answer()
        {
            var player        = FakePlayerRepository.Players.Single();
            var newQuestionId = TestDataGenerator.GetRandomSecurityQuestion();
            var newAnswer     = "";
            var e             = Assert.Throws <MemberApiValidationException>(async() => await PlayerWebservice.ChangeSecurityQuestionAsync(new ChangeSecurityQuestionRequest
            {
                Id = player.Id.ToString(),
                SecurityQuestionId = newQuestionId,
                SecurityAnswer     = newAnswer,
            }));

            Assert.AreEqual(RegisterValidatorResponseCodes.SecurityAnswerIsMissing.ToString(), e.Message);
        }