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

            newPasswordReset = tu.CreatePasswordResetObject(newUser);
            var expected = true;

            //Act
            using (_db = tu.CreateDataBaseContext())
            {
                rs.CreatePasswordReset(_db, newPasswordReset);
                _db.SaveChanges();
                var actual = rs.ExistingReset(_db, newPasswordReset.ResetToken);
                //Assert
                Assert.IsNotNull(actual);
                Assert.AreEqual(actual, expected);
            }
        }
Beispiel #2
0
        public void ExistingPasswordReset_Fail()
        {
            //Arrange
            var newUser = tu.CreateUserObject();

            newPasswordReset = tu.CreatePasswordResetObject(newUser);
            var expected = true;

            //Act
            using (var _db = tu.CreateDataBaseContext())
            {
                ResetService rs     = new ResetService(_db);
                var          actual = rs.ExistingReset(newPasswordReset.ResetToken);
                //Assert
                Assert.IsFalse(actual);
                Assert.AreNotEqual(actual, expected);
            }
        }