public static void CleanupTestClass() { // Use the App.config to set the properties of the MongoDB database. mongoProvider = (MongoDBMembershipProvider)Membership.Provider; // Removes from the database the 10 sample users. for (int i = 1; i <= 10; i++) { mongoProvider.DeleteUser("username" + i, true); } }
public static void InitializeTestClass(TestContext context) { // Use the App.config to set the properties of the MongoDB database. mongoProvider = (MongoDBMembershipProvider)Membership.Provider; // Clean up common usernames used accross the different tests. foreach (string username in commonUsernamesUsedInTests) { MembershipUser user = mongoProvider.GetUser(username, false); if (user != null) { mongoProvider.DeleteUser(username, true); } } }