Ejemplo n.º 1
0
        public void Cleanup()
        {
            // Cleanup any possible test users
            CosmoMongerMembershipProvider provider = new CosmoMongerMembershipProvider();

            provider.DeleteUser(this.baseTestUsername, true);
            provider.DeleteUser("1" + this.baseTestUsername, true);
            provider.DeleteUser("2" + this.baseTestUsername, true);
        }
Ejemplo n.º 2
0
        public void Cleanup()
        {
            // Cleanup any possible test players
            CosmoMongerMembershipProvider provider = new CosmoMongerMembershipProvider();
            int totalRecords             = 0;
            MembershipUserCollection col = provider.FindUsersByName(this.baseTestUsername, 0, 1000, out totalRecords);

            Assert.That(totalRecords, Is.LessThanOrEqualTo(1000), "BasePlayerTest class coded to only delete 1000 test users");
            foreach (MembershipUser user in col)
            {
                provider.DeleteUser(user.UserName, true);
            }
        }
Ejemplo n.º 3
0
        public void DeleteUser()
        {
            CosmoMongerMembershipProvider provider = new CosmoMongerMembershipProvider();
            MembershipCreateStatus        status;
            CosmoMongerMembershipUser     testUser = (CosmoMongerMembershipUser)provider.CreateUser(this.baseTestUsername, "test1000", this.baseTestEmail, null, null, true, null, out status);

            Assert.IsNotNull(testUser, "Test User was created. status = {0}", new object[] { status });

            // Test the deleting of the user
            bool deleted = provider.DeleteUser(this.baseTestUsername, true);

            Assert.IsTrue(deleted, "The DeleteUser method should have returned true");

            testUser = (CosmoMongerMembershipUser)provider.GetUser(this.baseTestUsername, false);
            Assert.IsNull(testUser, "Test User has been deleted from the database");
        }
Ejemplo n.º 4
0
        public void DeleteUserLeaveUserData()
        {
            CosmoMongerMembershipProvider provider = new CosmoMongerMembershipProvider();
            MembershipCreateStatus        status;
            CosmoMongerMembershipUser     testUser = (CosmoMongerMembershipUser)provider.CreateUser(this.baseTestUsername, "test1000", this.baseTestEmail, null, null, true, null, out status);

            Assert.IsNotNull(testUser, "Test User was created. status = {0}", new object[] { status });

            try
            {
                // Test the deleting of the user
                provider.DeleteUser(this.baseTestUsername, false);
                Assert.Fail("The DeleteUser method should have thrown an exception");
            }
            catch (ArgumentException ex)
            {
                Assert.AreEqual("deleteAllRelatedData", ex.ParamName, "Failed argument should be deleteAllRelatedData.");
            }

            testUser = (CosmoMongerMembershipUser)provider.GetUser(this.baseTestUsername, false);
            Assert.IsNotNull(testUser, "Test User should still be in the database");
        }