Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/10 19:48:26 (14 years ago)
Author:
bfarka
Message:

changed persistence for roles and implemented first Method in RoleProvider --> FinAllUsers (#1046)

File:
1 edited

Legend:

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

    r3948 r3951  
    99  public class HeuristicLabRoleProviderTest : AbstractHeuristicLabTest {
    1010    private TestContext testContextInstance;
    11 
     11    private const string TEST_ROLE_NAME = "testRole";
    1212    /// <summary>
    1313    ///Gets or sets the test context which provides
     
    6969
    7070    /// <summary>
    71     ///A test for RoleExists
     71    ///tests if the RoleExits method works --> test is done in a positiv and negativ way
    7272    ///</summary>
    7373    [TestMethod()]
    7474    public void RoleExistsTest() {
    75       HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
    76       string roleName = string.Empty; // TODO: Initialize to an appropriate value
    77       bool expected = false; // TODO: Initialize to an appropriate value
    78       bool actual;
    79       actual = target.RoleExists(roleName);
    80       Assert.AreEqual(expected, actual);
    81       Assert.Inconclusive("Verify the correctness of this test method.");
     75      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider();
     76      Persistence.HeuristicLabRole role = new Persistence.HeuristicLabRole();
     77      role.RoleName = TEST_ROLE_NAME;
     78      Persistence.DataClassesDataContext db = Persistence.DatabaseUtil.createDataClassesDataContext();
     79      db.HeuristicLabRole.InsertOnSubmit((Persistence.HeuristicLabRole)role);
     80      db.SubmitChanges();
     81      Assert.IsTrue(target.RoleExists(TEST_ROLE_NAME));
     82      Assert.IsFalse(target.RoleExists(TEST_ROLE_NAME + TEST_ROLE_NAME));
    8283    }
    8384
Note: See TracChangeset for help on using the changeset viewer.