Ejemplo n.º 1
0
        public void FindUsersByEmail()
        {
            MembershipCreateStatus status;

            Provider.CreateUser("test user 1",
                                "test password",
                                "*****@*****.**",
                                "question",
                                "answer",
                                true,
                                Guid.NewGuid(),
                                out status);

            Provider.CreateUser("test user 2",
                                "test password",
                                "*****@*****.**",
                                "question",
                                "answer",
                                true,
                                Guid.NewGuid(),
                                out status);

            Provider.CreateUser("test user 3",
                                "test password",
                                "*****@*****.**",
                                "question",
                                "answer",
                                true,
                                Guid.NewGuid(),
                                out status);

            int totalRecords = 0;
            var found        = Provider.FindUsersByEmail("*****@*****.**", 0, 10, out totalRecords);

            Assert.That(found, Is.Not.Null);
            Assert.That(found.Count, Is.EqualTo(1));
            Assert.That(totalRecords, Is.EqualTo(1));

            found = Provider.FindUsersByEmail("email*", 0, 10, out totalRecords);

            Assert.That(found, Is.Not.Null);
            Assert.That(found.Count, Is.EqualTo(2));
            Assert.That(totalRecords, Is.EqualTo(2));

            found = Provider.FindUsersByEmail("*@anotherdomain.com", 0, 10, out totalRecords);

            Assert.That(found, Is.Not.Null);
            Assert.That(found.Count, Is.EqualTo(1));
            Assert.That(totalRecords, Is.EqualTo(1));
        }