- Timestamp:
- 07/06/10 13:48:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabRoleProviderTest.cs
r3978 r4000 94 94 //and add all these users to groups admin and users 95 95 AddUsersToRolesTest(); 96 HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); 96 HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); 97 97 string[] users = new string[2]; 98 98 string[] roles = new string[1]; … … 278 278 [TestMethod()] 279 279 public void DeleteRoleTest() { 280 HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value 281 string roleName = string.Empty; // TODO: Initialize to an appropriate value 282 bool throwOnPopulatedRole = false; // TODO: Initialize to an appropriate value 283 bool expected = false; // TODO: Initialize to an appropriate value 284 bool actual; 285 actual = target.DeleteRole(roleName, throwOnPopulatedRole); 286 Assert.AreEqual(expected, actual); 287 Assert.Inconclusive("Verify the correctness of this test method."); 280 281 //creates users dkhan,hmayer,bfarka (with AddUsersToRolesTest()) 282 //and add all these users to groups admin and users 283 AddUsersToRolesTest(); 284 HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); 285 string[] users = new string[2]; 286 string[] roles = new string[1]; 287 288 //remove hmayer from role admin 289 users[0] = "hmayr"; 290 roles[0] = "admin"; 291 292 //before removing, check if all three users exits correctly in admin group 293 Assert.IsTrue((target.GetRolesForUser("hmayr").ToList()).Contains(roles[0])); 294 Assert.IsTrue((target.GetRolesForUser("dkhan").ToList()).Contains(roles[0])); 295 Assert.IsTrue((target.GetRolesForUser("bfarka").ToList()).Contains(roles[0])); 296 297 //try to delete Role admin (with user hmayr from admin group exists) 298 Assert.IsFalse(target.DeleteRole(roles[0], true)); 299 300 Assert.IsTrue(target.IsUserInRole(users[0], roles[0])); 301 302 //final populateRole if false 303 //try to delete Role admin (with user hmayr from admin group exists) 304 Assert.IsTrue(target.DeleteRole(roles[0], false)); 305 Assert.IsFalse(target.IsUserInRole(users[0], roles[0])); 306 Assert.IsFalse((target.GetRolesForUser("hmayr").ToList()).Contains(roles[0])); 288 307 } 289 308 … … 351 370 try { 352 371 Persistence.HeuristicLabRole role = new Persistence.HeuristicLabRole(); 353 role.RoleName = "role1";372 role.RoleName = "role1"; 354 373 Persistence.HeuristicLabRole role1 = new Persistence.HeuristicLabRole(); 355 role1.RoleName = "role1";374 role1.RoleName = "role1"; 356 375 db.HeuristicLabRole.InsertOnSubmit(role); 357 376 db.HeuristicLabRole.InsertOnSubmit(role1); … … 364 383 } 365 384 } 366 367 368 369 370 371 } 385 } //HeuristicLabRoleProviderTest
Note: See TracChangeset
for help on using the changeset viewer.