예제 #1
0
 public async Task AddUser(string displayName, string username, string password)
 {
     var passwordHash = _hashHelper.GetHashString(password);
     await _userDal.Add(new User
     {
         Username    = username,
         DisplayName = displayName,
         Password    = passwordHash
     });
 }
예제 #2
0
        public void GetHash_WhenGivenSameString_ReturnTheSameHash()
        {
            var someString = "password123";//Guid.NewGuid().ToString();

            var returnValue = _sut.GetHashString(someString);

            Debug.WriteLine("The value is {0} and the hash {1}.", someString, returnValue);
            for (var i = 0; i < 10; i++)
            {
                Assert.AreEqual(returnValue, _sut.GetHashString(someString));
            }
        }