Esempio n. 1
0
        public void FindUsersForDomain()
        {
            // Arrange
            CreateUsersInDocumentStore(RavenDBMembershipProvider.DocumentStore, 10);

            // Act
            int totalRecords;
            var membershipUsers = _provider.FindUsersByEmail("@foo.bar", 0, 2, out totalRecords);
            int totalRecordsForUnknownDomain;
            var membershipUsersForUnknownDomain = _provider.FindUsersByEmail("@foo.baz", 0, 2, out totalRecordsForUnknownDomain);

            // Assert
            Assert.AreEqual(10, totalRecords); // All users should be returned
            Assert.AreEqual(2, membershipUsers.Count);
            Assert.AreEqual(0, totalRecordsForUnknownDomain);
            Assert.AreEqual(0, membershipUsersForUnknownDomain.Count);
        }
Esempio n. 2
0
        public void FindUsersForDomain()
        {
            using (var store = NewInMemoryStore())
            {
                // Arrange
                CreateUsersInDocumentStore(store, 10);
                var provider = new RavenDBMembershipProvider();
                provider.DocumentStore = store;

                // Act
                Thread.Sleep(500);
                int totalRecords;
                var membershipUsers = provider.FindUsersByEmail("@foo.bar", 0, 2, out totalRecords);
                int totalRecordsForUnknownDomain;
                var membershipUsersForUnknownDomain = provider.FindUsersByEmail("@foo.baz", 0, 2, out totalRecordsForUnknownDomain);

                // Assert
                Assert.Equal(10, totalRecords);                 // All users should be returned
                Assert.Equal(2, membershipUsers.Count);
                Assert.Equal(0, totalRecordsForUnknownDomain);
                Assert.Equal(0, membershipUsersForUnknownDomain.Count);
            }
        }