Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/10 23:13:56 (14 years ago)
Author:
bfarka
Message:
 
File:
1 edited

Legend:

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

    r4020 r4021  
    55using Microsoft.VisualStudio.TestTools.UnitTesting;
    66using System.Web.Security;
     7using Service.Provider;
    78
    89namespace UnitTests.service {
     
    3435      provider.CreateUser("testUser", "mypassword", "myMail", "question", "answer", true, null,out status);
    3536      Assert.AreEqual(MembershipCreateStatus.Success, status);
     37      HeuristicLabRoleProvider roleProvider = new HeuristicLabRoleProvider();
     38      roleProvider.CreateRole("Admin");
     39      roleProvider.AddUsersToRoles(new String[1]{"testUser"},new String[1]{"Admin"});
    3640
    3741      AuthorizationManagementServiceRemote.AuthorizationManagementServiceClient client = new AuthorizationManagementServiceRemote.AuthorizationManagementServiceClient();
     
    3943      client.ClientCredentials.UserName.Password = "mypassword";
    4044      client.CreateRole("roleName", true);
     45      roleProvider.RemoveUsersFromRoles(new String[1] { "testUser" }, new String[1] { "Admin" });
     46      try {
     47        client.CreateRole("roleName", true);
     48        Assert.Fail();
     49      }
     50      catch (Exception) {
     51        //should throw exception
     52      }
     53
     54
    4155    }
    4256
Note: See TracChangeset for help on using the changeset viewer.