public void TestFindInactiveProfilesByUserNameThatAreAuthenticated()
        {
            var membershipConfig = new NameValueCollection(_membershipConfig);
            var membershipProvider = new MongoMembershipProvider();
            membershipProvider.Initialize(DefaultMembershipName, membershipConfig);

            var profileConfig = new NameValueCollection(_profileConfig);
            var profileProvider = new MongoProfileProvider();
            profileProvider.Initialize(DefaultProfileName, profileConfig);

            SetUpTestProfiles(membershipProvider, profileProvider);

            int totalRecords = 0;
            var profiles = profileProvider.FindInactiveProfilesByUserName(
                ProfileAuthenticationOption.Authenticated, @"user\d*(0|1)", DateTime.Now.AddDays(-1), 0, 2, out totalRecords);

            Assert.AreEqual(4, totalRecords);
            Assert.AreEqual(2, profiles.Count);
            foreach (ProfileInfo p in profiles) {
                Assert.IsTrue(p.UserName.StartsWith("user") && (p.UserName.EndsWith("0") || p.UserName.EndsWith("1")));

                // All even records are authenticated in this test.
                Assert.IsTrue(Convert.ToInt32(p.UserName.Substring(4)) % 2 == 0);

                Assert.IsFalse(p.IsAnonymous);
                Assert.Greater(p.Size, 0);
            }
        }
        public void TestFindInactiveProfilesByUserName()
        {
            var membershipConfig = new NameValueCollection(_membershipConfig);
            var membershipProvider = new MongoMembershipProvider();
            membershipProvider.Initialize(DefaultMembershipName, membershipConfig);

            var profileConfig = new NameValueCollection(_profileConfig);
            var profileProvider = new MongoProfileProvider();
            profileProvider.Initialize(DefaultProfileName, profileConfig);

            SetUpTestProfiles(membershipProvider, profileProvider);

            int totalRecords = 0;
            var profiles = profileProvider.FindInactiveProfilesByUserName(
                ProfileAuthenticationOption.All, @"user\d*(0|1)", DateTime.Now.AddDays(-1), 0, 2, out totalRecords);

            Assert.AreEqual(8, totalRecords);
            Assert.AreEqual(2, profiles.Count);
            foreach (ProfileInfo p in profiles) {
                Assert.IsTrue(p.UserName.StartsWith("user") && (p.UserName.EndsWith("0") || p.UserName.EndsWith("1")));
                Assert.Greater(p.Size, 0);
            }
        }