Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/10 21:48:27 (14 years ago)
Author:
bfarka
Message:

implemented first working authorization test!
(#1046)

Location:
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/service
Files:
1 added
1 edited

Legend:

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

    r4002 r4020  
    44using System.Linq;
    55using Microsoft.VisualStudio.TestTools.UnitTesting;
     6using System.Web.Security;
    67
    78namespace UnitTests.service {
     
    2728      }
    2829    }
     30    [TestMethod()]
    2931    public void TestCreateRoleTest() {
    30       new ServiceManagementRemote.AuthorizationManagementServiceClient().CreateRole("myRole", true);
     32      MembershipProvider provider = Membership.Provider;
     33      MembershipCreateStatus status;
     34      provider.CreateUser("testUser", "mypassword", "myMail", "question", "answer", true, null,out status);
     35      Assert.AreEqual(MembershipCreateStatus.Success, status);
     36
     37      AuthorizationManagementServiceRemote.AuthorizationManagementServiceClient client = new AuthorizationManagementServiceRemote.AuthorizationManagementServiceClient();
     38      client.ClientCredentials.UserName.UserName = "testUser";
     39      client.ClientCredentials.UserName.Password = "mypassword";
     40      client.CreateRole("roleName", true);
    3141    }
    3242
Note: See TracChangeset for help on using the changeset viewer.