Esempio n. 1
0
        public async void ConfirmUserPassword_Should_Succeed()
        {
            var userCreds = await UserAuthentication.GenerateUserCreds("woodstock", "doghouse");

            var validUser = await UserAuthentication.ConfirmUserPassword(userCreds, "doghouse");

            Assert.True(validUser);
        }
Esempio n. 2
0
        public async void MultipleUserCreds_Should_BeDistinct()
        {
            var userCreds1 = await UserAuthentication.GenerateUserCreds("linus", "blanket");

            var userCreds2 = await UserAuthentication.GenerateUserCreds("linus", "blanket");

            Assert.NotEqual(userCreds1.HashedPassword, userCreds2.HashedPassword);
            Assert.NotEqual(userCreds1.Salt, userCreds2.Salt);
            Assert.Equal(userCreds1.HashingIterations, userCreds2.HashingIterations);
        }
Esempio n. 3
0
        public async void GenerateUserCreds_Should_Succeed()
        {
            var userCreds = await UserAuthentication.GenerateUserCreds("snoopy", "myPassword");

            Assert.NotEqual(userCreds.HashedPassword, "myPassword");
        }