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)); }
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")); } }
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)); }