Example #1
0
        private bool PlayerWasSuccessfullyRegistered()
        {
            BCryptHashGenerator hashGenerator = new BCryptHashGenerator();
            string salt = hashGenerator.GenerateSalt();
            string encryptedPassword = hashGenerator.GenerateEncryptedString(_password, salt);

            MemoryGameService.PlayerRegistryServiceClient playerRegistryServiceClient =
                new MemoryGameService.PlayerRegistryServiceClient();

            PlayerDto playerDTO = new PlayerDto()
            {
                Username          = _username,
                EmailAddress      = _emailAddress,
                Password          = encryptedPassword,
                VerificationToken = _verificationToken
            };

            bool playerWasSuccessfullyRegistered = playerRegistryServiceClient.RegisterNewPlayer(playerDTO, salt);

            return(playerWasSuccessfullyRegistered);
        }
Example #2
0
 /// <summary>
 /// The <c>Register</c> constructor.
 /// </summary>
 public Register()
 {
     InitializeComponent();
     _playerRegistryServiceClient =
         new MemoryGameService.PlayerRegistryServiceClient();
 }