Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Services.Authentication Prototype/UnitTests/service/HeuristicLabManagementServiceTest.cs @ 4020

Last change on this file since 4020 was 4020, checked in by bfarka, 14 years ago

implemented first working authorization test!
(#1046)

File size: 1.5 KB
Line 
1using System;
2using System.Text;
3using System.Collections.Generic;
4using System.Linq;
5using Microsoft.VisualStudio.TestTools.UnitTesting;
6using System.Web.Security;
7
8namespace UnitTests.service {
9  /// <summary>
10  /// Zusammenfassungsbeschreibung für HeuristicLabManagementServiceTest
11  /// </summary>
12  [TestClass]
13  public class HeuristicLabManagementServiceTest : AbstractHeuristicLabServiceTest {
14   
15
16    private TestContext testContextInstance;
17
18    /// <summary>
19    ///Ruft den Textkontext mit Informationen über
20    ///den aktuellen Testlauf sowie Funktionalität für diesen auf oder legt diese fest.
21    ///</summary>
22    public TestContext TestContext {
23      get {
24        return testContextInstance;
25      }
26      set {
27        testContextInstance = value;
28      }
29    }
30    [TestMethod()]
31    public void TestCreateRoleTest() {
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);
41    }
42
43   
44  }
45}
Note: See TracBrowser for help on using the repository browser.