Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/09/10 17:19:19 (14 years ago)
Author:
bfarka
Message:

last bugfixes for project #1046

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabRoleProviderTest.cs

    r4002 r4024  
    142142      Assert.IsTrue(target.IsUserInRole("mholper", "admin"));
    143143      Assert.IsFalse(target.IsUserInRole("mholper", "user"));
     144
     145      target.AddChildRole("admin", "users");
     146      Assert.IsTrue(target.IsUserInRole("mholper", "users"));
    144147    }
    145148
     
    382385      }
    383386    }
     387
     388    [TestMethod()]
     389    public void AddChildRoleTest() {
     390      HeuristicLabRoleProvider roleProvider = new HeuristicLabRoleProvider();
     391      roleProvider.CreateRole("parent");
     392      roleProvider.CreateRole("child");
     393      roleProvider.AddChildRole("parent", "child");
     394      Persistence.HeuristicLabRole parent = db.HeuristicLabRole.Single(x => x.RoleName == "parent");
     395      Persistence.HeuristicLabRole child = parent.HeuristicLabRoleChilds.ToList().ElementAt(0);
     396      Assert.AreEqual(child.RoleName, "child");
     397
     398    }
     399
    384400  }
    385401}
Note: See TracChangeset for help on using the changeset viewer.