Esempio n. 1
0
        public bool ValidateUser(string userName, string password)
        {
            if (String.IsNullOrEmpty(userName))
            {
                throw new ArgumentException("Value cannot be null or empty.", "userName");
            }
            if (String.IsNullOrEmpty(password))
            {
                throw new ArgumentException("Value cannot be null or empty.", "password");
            }

            return(_provider.ValidateUser(userName, password));
        }
Esempio n. 2
0
        public void ChangePassword()
        {
            using (var store = NewInMemoryStore())
            {
                // Arrange
                var provider = new RavenDBMembershipProvider();
                provider.DocumentStore = store;
                MembershipCreateStatus status;
                var membershipUser = provider.CreateUser("martijn", "1234ABCD", "*****@*****.**", null, null, true, null, out status);

                // Act
                provider.ChangePassword("martijn", "1234ABCD", "DCBA4321");
                Thread.Sleep(500);

                // Assert
                Assert.True(provider.ValidateUser("martijn", "DCBA4321"));
            }
        }
Esempio n. 3
0
 public void ValidateUserTest_should_return_false_if_username_is_null_or_empty()
 {
     //Act and Assert
     Assert.IsFalse(_provider.ValidateUser("", ""));
     Assert.IsFalse(_provider.ValidateUser(null, null));
 }