public void CanChangePasswordQuestionAndAnswer()
        {
            //arrange
            var created = CreateUsers(1);
            RavenDbMembershipProvider provider = new RavenDbMembershipProvider();

            //act
            bool actual = provider.ChangePasswordQuestionAndAnswer(created.First().UserName, TEST_PASSWORD, "new question", "new answer");

            //assert
            Assert.IsTrue(actual);
        }
        public void CanResetPassword()
        {
            //arrange
            var created = CreateUsers(1);
            RavenDbMembershipProvider provider = (RavenDbMembershipProvider)Membership.Provider;

            provider.ChangePasswordQuestionAndAnswer(created.First().UserName, TEST_PASSWORD, "questionwashere", "answerwashere");

            //act
            string actual = provider.ResetPassword(created.First().UserName, "answerwashere");

            Assert.IsNotNullOrEmpty(actual);
            //assert that the user can validate with the newly provided autogenerated password
            Assert.IsTrue(provider.ValidateUser(created.First().UserName, actual));
        }
        public void CanChangePassword()
        {
            //arrange
            var created = CreateUsers(1);
            RavenDbMembershipProvider provider = (RavenDbMembershipProvider)Membership.Provider;

            //act
            provider.ChangePassword(created.First().UserName, TEST_PASSWORD, "newpassword");

            //assert
            bool oldPasswordCanValidate = Membership.ValidateUser(created.First().UserName, TEST_PASSWORD);

            Assert.IsFalse(oldPasswordCanValidate);

            bool newPasswordCanValidate = Membership.ValidateUser(created.First().UserName, "newpassword");

            Assert.IsTrue(newPasswordCanValidate);
        }
        public void CanChangePasswordQuestionAndAnswer()
        {
            //arrange
            var created = CreateUsers(1);
            RavenDbMembershipProvider provider = new RavenDbMembershipProvider();

            //act
            bool actual = provider.ChangePasswordQuestionAndAnswer(created.First().UserName, TEST_PASSWORD, "new question", "new answer");

            //assert
            Assert.IsTrue(actual);
        }
        public void CanGetPasswordShouldThrowNotSupportedException()
        {
            RavenDbMembershipProvider provider = new RavenDbMembershipProvider();

            Assert.Throws<NotSupportedException>(() => provider.GetPassword("nothing", "doesntmatter"));
        }
        public void CanGetPasswordShouldThrowNotSupportedException()
        {
            RavenDbMembershipProvider provider = new RavenDbMembershipProvider();

            Assert.Throws <NotSupportedException>(() => provider.GetPassword("nothing", "doesntmatter"));
        }