예제 #1
0
        public void GetAllUsersShouldReturnAllUsers()
        {
            using (var store = NewInMemoryStore())
            {
                // Arrange
                CreateUsersInDocumentStore(store, 5);
                var provider = new RavenDBMembershipProvider();
                provider.DocumentStore = store;

                // Act
                Thread.Sleep(500);
                int totalRecords;
                var membershipUsers = provider.GetAllUsers(0, 10, out totalRecords);

                // Assert
                Assert.Equal(5, totalRecords);
                Assert.Equal(5, membershipUsers.Count);
            }
        }
예제 #2
0
        public void FindUsersWithPaging()
        {
            using (var store = NewInMemoryStore())
            {
                // Arrange
                CreateUsersInDocumentStore(store, 10);
                var provider = new RavenDBMembershipProvider();
                provider.DocumentStore = store;

                // Act
                Thread.Sleep(500);
                int totalRecords;
                var membershipUsers = provider.GetAllUsers(0, 5, out totalRecords);

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