Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabRoleProviderTest.cs @ 3948

Last change on this file since 3948 was 3948, checked in by hmayr, 14 years ago

following changes (#1046):

  • extended HeuristicLabUser.cs (additional methods)
  • implemented a 2. demo method for HeuristicLabMembershipProvider.cs
  • recreated two test classes in English language
File size: 8.3 KB
Line 
1using Service.Provider;
2using Microsoft.VisualStudio.TestTools.UnitTesting;
3namespace UnitTests {
4  /// <summary>
5  ///This is a test class for HeuristicLabRoleProviderTest and is intended
6  ///to contain all HeuristicLabRoleProviderTest Unit Tests
7  ///</summary>
8  [TestClass()]
9  public class HeuristicLabRoleProviderTest : AbstractHeuristicLabTest {
10    private TestContext testContextInstance;
11
12    /// <summary>
13    ///Gets or sets the test context which provides
14    ///information about and functionality for the current test run.
15    ///</summary>
16    public TestContext TestContext {
17      get {
18        return testContextInstance;
19      }
20      set {
21        testContextInstance = value;
22      }
23    }
24
25    #region Additional test attributes
26    //
27    //You can use the following additional attributes as you write your tests:
28    //
29    //Use ClassInitialize to run code before running the first test in the class
30    //[ClassInitialize()]
31    //public static void MyClassInitialize(TestContext testContext)
32    //{
33    //}
34    //
35    //Use ClassCleanup to run code after all tests in a class have run
36    //[ClassCleanup()]
37    //public static void MyClassCleanup()
38    //{
39    //}
40    //
41    //Use TestInitialize to run code before running each test
42    //[TestInitialize()]
43    //public void MyTestInitialize()
44    //{
45    //}
46    //
47    //Use TestCleanup to run code after each test has run
48    //[TestCleanup()]
49    //public void MyTestCleanup()
50    //{
51    //}
52    //
53    #endregion
54
55
56    /// <summary>
57    ///A test for ApplicationName
58    ///</summary>
59    [TestMethod()]
60    public void ApplicationNameTest() {
61      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
62      string expected = string.Empty; // TODO: Initialize to an appropriate value
63      string actual;
64      target.ApplicationName = expected;
65      actual = target.ApplicationName;
66      Assert.AreEqual(expected, actual);
67      Assert.Inconclusive("Verify the correctness of this test method.");
68    }
69
70    /// <summary>
71    ///A test for RoleExists
72    ///</summary>
73    [TestMethod()]
74    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.");
82    }
83
84    /// <summary>
85    ///A test for RemoveUsersFromRoles
86    ///</summary>
87    [TestMethod()]
88    public void RemoveUsersFromRolesTest() {
89      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
90      string[] usernames = null; // TODO: Initialize to an appropriate value
91      string[] roleNames = null; // TODO: Initialize to an appropriate value
92      target.RemoveUsersFromRoles(usernames, roleNames);
93      Assert.Inconclusive("A method that does not return a value cannot be verified.");
94    }
95
96    /// <summary>
97    ///A test for IsUserInRole
98    ///</summary>
99    [TestMethod()]
100    public void IsUserInRoleTest() {
101      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
102      string username = string.Empty; // TODO: Initialize to an appropriate value
103      string roleName = string.Empty; // TODO: Initialize to an appropriate value
104      bool expected = false; // TODO: Initialize to an appropriate value
105      bool actual;
106      actual = target.IsUserInRole(username, roleName);
107      Assert.AreEqual(expected, actual);
108      Assert.Inconclusive("Verify the correctness of this test method.");
109    }
110
111    /// <summary>
112    ///A test for GetUsersInRole
113    ///</summary>
114    [TestMethod()]
115    public void GetUsersInRoleTest() {
116      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
117      string roleName = string.Empty; // TODO: Initialize to an appropriate value
118      string[] expected = null; // TODO: Initialize to an appropriate value
119      string[] actual;
120      actual = target.GetUsersInRole(roleName);
121      Assert.AreEqual(expected, actual);
122      Assert.Inconclusive("Verify the correctness of this test method.");
123    }
124
125    /// <summary>
126    ///A test for GetRolesForUser
127    ///</summary>
128    [TestMethod()]
129    public void GetRolesForUserTest() {
130      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
131      string username = string.Empty; // TODO: Initialize to an appropriate value
132      string[] expected = null; // TODO: Initialize to an appropriate value
133      string[] actual;
134      actual = target.GetRolesForUser(username);
135      Assert.AreEqual(expected, actual);
136      Assert.Inconclusive("Verify the correctness of this test method.");
137    }
138
139    /// <summary>
140    ///A test for GetAllRoles
141    ///</summary>
142    [TestMethod()]
143    public void GetAllRolesTest() {
144      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
145      string[] expected = null; // TODO: Initialize to an appropriate value
146      string[] actual;
147      actual = target.GetAllRoles();
148      Assert.AreEqual(expected, actual);
149      Assert.Inconclusive("Verify the correctness of this test method.");
150    }
151
152    /// <summary>
153    ///A test for FindUsersInRole
154    ///</summary>
155    [TestMethod()]
156    public void FindUsersInRoleTest() {
157      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
158      string roleName = string.Empty; // TODO: Initialize to an appropriate value
159      string usernameToMatch = string.Empty; // TODO: Initialize to an appropriate value
160      string[] expected = null; // TODO: Initialize to an appropriate value
161      string[] actual;
162      actual = target.FindUsersInRole(roleName, usernameToMatch);
163      Assert.AreEqual(expected, actual);
164      Assert.Inconclusive("Verify the correctness of this test method.");
165    }
166
167    /// <summary>
168    ///A test for DeleteRole
169    ///</summary>
170    [TestMethod()]
171    public void DeleteRoleTest() {
172      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
173      string roleName = string.Empty; // TODO: Initialize to an appropriate value
174      bool throwOnPopulatedRole = false; // TODO: Initialize to an appropriate value
175      bool expected = false; // TODO: Initialize to an appropriate value
176      bool actual;
177      actual = target.DeleteRole(roleName, throwOnPopulatedRole);
178      Assert.AreEqual(expected, actual);
179      Assert.Inconclusive("Verify the correctness of this test method.");
180    }
181
182    /// <summary>
183    ///A test for CreateRole
184    ///</summary>
185    [TestMethod()]
186    public void CreateRoleTest() {
187      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
188      string roleName = string.Empty; // TODO: Initialize to an appropriate value
189      target.CreateRole(roleName);
190      Assert.Inconclusive("A method that does not return a value cannot be verified.");
191    }
192
193    /// <summary>
194    ///A test for AddUsersToRoles
195    ///</summary>
196    [TestMethod()]
197    public void AddUsersToRolesTest() {
198      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
199      string[] usernames = null; // TODO: Initialize to an appropriate value
200      string[] roleNames = null; // TODO: Initialize to an appropriate value
201      target.AddUsersToRoles(usernames, roleNames);
202      Assert.Inconclusive("A method that does not return a value cannot be verified.");
203    }
204
205    /// <summary>
206    ///A test for HeuristicLabRoleProvider Constructor
207    ///</summary>
208    [TestMethod()]
209    public void HeuristicLabRoleProviderConstructorTest() {
210      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider();
211      Assert.Inconclusive("TODO: Implement code to verify target");
212    }
213  }
214}
Note: See TracBrowser for help on using the repository browser.