public void Empty_password_validation_works()
        {
            var e = Assert.Throws <MemberApiValidationException>(
                async() => await PlayerWebservice.ChangePasswordAsync(new ChangePasswordRequest {
                Username = _registrationData.Username, OldPassword = _registrationData.Password, NewPassword = string.Empty
            }));

            Assert.AreEqual(PlayerAccountResponseCode.PasswordShouldNotBeEmpty.ToString(), e.Message);
        }
        public void Password_length_validation_works(string password)
        {
            var e = Assert.Throws <MemberApiValidationException>(
                async() => await PlayerWebservice.ChangePasswordAsync(new ChangePasswordRequest {
                Username = _registrationData.Username, OldPassword = _registrationData.Password, NewPassword = password
            }));

            Assert.IsNotEmpty(e.Message);
        }
        public void Player_is_absent_validation_works()
        {
            var e = Assert.Throws <MemberApiValidationException>(
                async() => await PlayerWebservice.ChangePasswordAsync(new ChangePasswordRequest {
                Username = "******", OldPassword = _registrationData.Password, NewPassword = "******"
            }));

            Assert.IsNotEmpty(e.Message);
            Assert.AreEqual(PlayerAccountResponseCode.PlayerDoesNotExist.ToString(), e.Message);
        }
        public async void Can_change_password()
        {
            var authRepository       = Container.Resolve <IAuthRepository>();
            var initialPasswordValue = authRepository.Actors.Last().EncryptedPassword;
            await PlayerWebservice.ChangePasswordAsync(new ChangePasswordRequest
            {
                Username    = _registrationData.Username,
                OldPassword = _registrationData.Password,
                NewPassword = "******"
            });

            var changedPasswordValue = authRepository.Actors.Last().EncryptedPassword;

            //Assert.False(result.IsErrorResponse());
            Assert.AreNotEqual(initialPasswordValue, changedPasswordValue);
        }
        public void Old_password_validation_works()
        {
            var    newPassword = TestDataGenerator.GetRandomString();
            string oldPasswordToEnter;

            do
            {
                oldPasswordToEnter = TestDataGenerator.GetRandomString();
            }while (oldPasswordToEnter == _registrationData.Password);

            var e = Assert.Throws <MemberApiValidationException>(
                async() => await PlayerWebservice.ChangePasswordAsync(new ChangePasswordRequest {
                Username = _registrationData.Username, OldPassword = oldPasswordToEnter, NewPassword = newPassword
            }));

            Assert.IsNotEmpty(e.Message);
            Assert.AreEqual(PlayerAccountResponseCode.UsernamePasswordCombinationIsNotValid.ToString(), e.Message);
        }