Beispiel #1
0
        public void DeletePasswordReset_Pass()
        {
            //Arrange
            var newUser = tu.CreateUserObject();

            tu.CreateUserInDb(newUser);
            var expected = pm.CreatePasswordReset(newUser.Id);
            //Act
            var response = pm.DeletePasswordReset(expected.ResetToken);
            var result   = pm.ExistingResetToken(expected.ResetToken);

            //Assert
            Assert.IsNotNull(response);
            Assert.IsFalse(result);
        }
Beispiel #2
0
        public void CheckExistingPasswordReset_Pass()
        {
            //Arrange
            var newUser = tu.CreateUserObject();

            tu.CreateUserInDb(newUser);
            using (_db = tu.CreateDataBaseContext())
            {
                PasswordManager pm = new PasswordManager(_db);
                var             newlyAddedPasswordReset = pm.CreatePasswordReset(newUser.Id);
                //Act
                var response = pm.ExistingResetToken(newlyAddedPasswordReset.ResetToken);
                //Assert
                Assert.IsNotNull(response);
                Assert.IsTrue(response);
            }
        }
Beispiel #3
0
        public void DeletePasswordReset_Pass()
        {
            //Arrange
            var newUser = tu.CreateUserObject();

            tu.CreateUserInDb(newUser);
            using (_db = tu.CreateDataBaseContext())
            {
                PasswordManager pm       = new PasswordManager(_db);
                var             expected = pm.CreatePasswordReset(newUser.Id);
                //Act
                var response = pm.DeletePasswordReset(expected.ResetToken);
                var result   = pm.ExistingResetToken(expected.ResetToken);
                //Assert
                Assert.IsNotNull(response);
                Assert.IsFalse(result);
            }
        }
Beispiel #4
0
        public void CheckExistingPasswordReset_Fail()
        {
            //Arrange
            var newUser = tu.CreateUserObject();

            tu.CreateUserInDb(newUser);
            string resetToken = "fakeResetToken";

            //Act
            using (_db = tu.CreateDataBaseContext())
            {
                PasswordManager pm       = new PasswordManager(_db);
                var             response = pm.ExistingResetToken(resetToken);
                //Assert
                Assert.IsNotNull(response);
                Assert.IsFalse(response);
            }
        }