public void TestGetRolesForUserWhenHasUserDoesNotExist() { var membershipConfig = new NameValueCollection(_membershipConfig); var roleConfig = new NameValueCollection(_roleConfig); var membershipProvider = new MongoMembershipProvider(); membershipProvider.Initialize(DefaultMembershipName, membershipConfig); var roleProvider = new MongoRoleProvider(); roleProvider.Initialize(DefaultRoleName, roleConfig); MembershipCreateStatus status; membershipProvider.CreateUser("user1", "123456", "*****@*****.**", null, null, true, null, out status); membershipProvider.CreateUser("user2", "123456", "*****@*****.**", null, null, true, null, out status); roleProvider.CreateRole("role1"); roleProvider.CreateRole("role2"); roleProvider.CreateRole("role3"); roleProvider.AddUsersToRoles(new[] { "user1", }, new[] { "role1", "role2" }); var roles = roleProvider.GetRolesForUser("user3"); Assert.AreEqual(0, roles.Length); }