Beispiel #1
0
        public void ChangePassword()
        {
            // Arrange
            MembershipCreateStatus status;
            var membershipUser = _provider.CreateUser("martijn", "1234ABCD", "*****@*****.**", null, null, true, null, out status);

            // Act
            _provider.ChangePassword("martijn", "1234ABCD", "DCBA4321");
            var o    = -1;
            var user = _provider.FindUsersByName("martijn", 0, 0, out o);

            // Assert
            Assert.True(_provider.ValidateUser("martijn", "DCBA4321"));
        }
Beispiel #2
0
        public void FindUsersByUsernamePart()
        {
            using (var store = NewInMemoryStore())
            {
                // Arrange
                CreateUsersInDocumentStore(store, 5);
                var provider = new RavenDBMembershipProvider();
                provider.DocumentStore = store;

                // Act
                Thread.Sleep(500);
                int totalRecords;
                var membershipUsers = provider.FindUsersByName("ser", 0, 10, out totalRecords);                 // Usernames are User1 .. Usern

                // Assert
                Assert.Equal(5, totalRecords);                 // All users should be returned
                Assert.Equal(5, membershipUsers.Count);
            }
        }