Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabMembershipProviderTest.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: 19.3 KB
Line 
1using Service.Provider;
2using Microsoft.VisualStudio.TestTools.UnitTesting;
3using System.Web.Security;
4
5namespace UnitTests {
6  /// <summary>
7  ///This is a test class for HeuristicLabMembershipProviderTest and is intended
8  ///to contain all HeuristicLabMembershipProviderTest Unit Tests
9  ///</summary>
10  [TestClass()]
11  public class HeuristicLabMembershipProviderTest : AbstractHeuristicLabTest {
12    private TestContext testContextInstance;
13
14    /// <summary>
15    ///Gets or sets the test context which provides
16    ///information about and functionality for the current test run.
17    ///</summary>
18    public TestContext TestContext {
19      get {
20        return testContextInstance;
21      }
22      set {
23        testContextInstance = value;
24      }
25    }
26
27    #region Additional test attributes
28    //
29    //You can use the following additional attributes as you write your tests:
30    //
31    //Use ClassInitialize to run code before running the first test in the class
32    //[ClassInitialize()]
33    //public static void MyClassInitialize(TestContext testContext)
34    //{
35    //}
36    //
37    //Use ClassCleanup to run code after all tests in a class have run
38    //[ClassCleanup()]
39    //public static void MyClassCleanup()
40    //{
41    //}
42    //
43    //Use TestInitialize to run code before running each test
44    //[TestInitialize()]
45    //public void MyTestInitialize()
46    //{
47    //}
48    //
49    //Use TestCleanup to run code after each test has run
50    //[TestCleanup()]
51    //public void MyTestCleanup()
52    //{
53    //}
54    //
55    #endregion
56
57
58    /// <summary>
59    ///A test for RequiresUniqueEmail
60    ///</summary>
61    [TestMethod()]
62    public void RequiresUniqueEmailTest() {
63      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
64      bool actual;
65      actual = target.RequiresUniqueEmail;
66      Assert.Inconclusive("Verify the correctness of this test method.");
67    }
68
69    /// <summary>
70    ///A test for RequiresQuestionAndAnswer
71    ///</summary>
72    [TestMethod()]
73    public void RequiresQuestionAndAnswerTest() {
74      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
75      bool actual;
76      actual = target.RequiresQuestionAndAnswer;
77      Assert.Inconclusive("Verify the correctness of this test method.");
78    }
79
80    /// <summary>
81    ///A test for PasswordStrengthRegularExpression
82    ///</summary>
83    [TestMethod()]
84    public void PasswordStrengthRegularExpressionTest() {
85      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
86      string actual;
87      actual = target.PasswordStrengthRegularExpression;
88      Assert.Inconclusive("Verify the correctness of this test method.");
89    }
90
91    /// <summary>
92    ///A test for PasswordFormat
93    ///</summary>
94    [TestMethod()]
95    public void PasswordFormatTest() {
96      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
97      MembershipPasswordFormat actual;
98      actual = target.PasswordFormat;
99      Assert.Inconclusive("Verify the correctness of this test method.");
100    }
101
102    /// <summary>
103    ///A test for PasswordAttemptWindow
104    ///</summary>
105    [TestMethod()]
106    public void PasswordAttemptWindowTest() {
107      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
108      int actual;
109      actual = target.PasswordAttemptWindow;
110      Assert.Inconclusive("Verify the correctness of this test method.");
111    }
112
113    /// <summary>
114    ///A test for MinRequiredPasswordLength
115    ///</summary>
116    [TestMethod()]
117    public void MinRequiredPasswordLengthTest() {
118      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
119      int actual;
120      actual = target.MinRequiredPasswordLength;
121      Assert.Inconclusive("Verify the correctness of this test method.");
122    }
123
124    /// <summary>
125    ///A test for MinRequiredNonAlphanumericCharacters
126    ///</summary>
127    [TestMethod()]
128    public void MinRequiredNonAlphanumericCharactersTest() {
129      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
130      int actual;
131      actual = target.MinRequiredNonAlphanumericCharacters;
132      Assert.Inconclusive("Verify the correctness of this test method.");
133    }
134
135    /// <summary>
136    ///A test for MaxInvalidPasswordAttempts
137    ///</summary>
138    [TestMethod()]
139    public void MaxInvalidPasswordAttemptsTest() {
140      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
141      int actual;
142      actual = target.MaxInvalidPasswordAttempts;
143      Assert.Inconclusive("Verify the correctness of this test method.");
144    }
145
146    /// <summary>
147    ///A test for EnablePasswordRetrieval
148    ///</summary>
149    [TestMethod()]
150    public void EnablePasswordRetrievalTest() {
151      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
152      bool actual;
153      actual = target.EnablePasswordRetrieval;
154      Assert.Inconclusive("Verify the correctness of this test method.");
155    }
156
157    /// <summary>
158    ///A test for EnablePasswordReset
159    ///</summary>
160    [TestMethod()]
161    public void EnablePasswordResetTest() {
162      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
163      bool actual;
164      actual = target.EnablePasswordReset;
165      Assert.Inconclusive("Verify the correctness of this test method.");
166    }
167
168    /// <summary>
169    ///A test for ApplicationName
170    ///</summary>
171    [TestMethod()]
172    public void ApplicationNameTest() {
173      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
174      string expected = string.Empty; // TODO: Initialize to an appropriate value
175      string actual;
176      target.ApplicationName = expected;
177      actual = target.ApplicationName;
178      Assert.AreEqual(expected, actual);
179      Assert.Inconclusive("Verify the correctness of this test method.");
180    }
181
182    /// <summary>
183    ///A test for ValidateUser
184    ///</summary>
185    [TestMethod()]
186    public void ValidateUserTest() {
187      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
188      string username = string.Empty; // TODO: Initialize to an appropriate value
189      string password = string.Empty; // TODO: Initialize to an appropriate value
190      bool expected = false; // TODO: Initialize to an appropriate value
191      bool actual;
192      actual = target.ValidateUser(username, password);
193      Assert.AreEqual(expected, actual);
194      Assert.Inconclusive("Verify the correctness of this test method.");
195    }
196
197    /// <summary>
198    ///A test for UpdateUser
199    ///</summary>
200    [TestMethod()]
201    public void UpdateUserTest() {
202      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
203      MembershipUser user = null; // TODO: Initialize to an appropriate value
204      target.UpdateUser(user);
205      Assert.Inconclusive("A method that does not return a value cannot be verified.");
206    }
207
208    /// <summary>
209    ///A test for UnlockUser
210    ///</summary>
211    [TestMethod()]
212    public void UnlockUserTest() {
213      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
214      string userName = string.Empty; // TODO: Initialize to an appropriate value
215      bool expected = false; // TODO: Initialize to an appropriate value
216      bool actual;
217      actual = target.UnlockUser(userName);
218      Assert.AreEqual(expected, actual);
219      Assert.Inconclusive("Verify the correctness of this test method.");
220    }
221
222    /// <summary>
223    ///A test for ResetPassword
224    ///</summary>
225    [TestMethod()]
226    public void ResetPasswordTest() {
227      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
228      string username = string.Empty; // TODO: Initialize to an appropriate value
229      string answer = string.Empty; // TODO: Initialize to an appropriate value
230      string expected = string.Empty; // TODO: Initialize to an appropriate value
231      string actual;
232      actual = target.ResetPassword(username, answer);
233      Assert.AreEqual(expected, actual);
234      Assert.Inconclusive("Verify the correctness of this test method.");
235    }
236
237    /// <summary>
238    ///A test for GetUserNameByEmail
239    ///</summary>
240    [TestMethod()]
241    public void GetUserNameByEmailTest() {
242      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
243      string email = string.Empty; // TODO: Initialize to an appropriate value
244      string expected = string.Empty; // TODO: Initialize to an appropriate value
245      string actual;
246      actual = target.GetUserNameByEmail(email);
247      Assert.AreEqual(expected, actual);
248      Assert.Inconclusive("Verify the correctness of this test method.");
249    }
250
251    /// <summary>
252    ///A test for GetUser
253    ///</summary>
254    [TestMethod()]
255    public void GetUserTest1() {
256      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
257      object providerUserKey = null; // TODO: Initialize to an appropriate value
258      bool userIsOnline = false; // TODO: Initialize to an appropriate value
259      MembershipUser expected = null; // TODO: Initialize to an appropriate value
260      MembershipUser actual;
261      actual = target.GetUser(providerUserKey, userIsOnline);
262      Assert.AreEqual(expected, actual);
263      Assert.Inconclusive("Verify the correctness of this test method.");
264    }
265
266    /// <summary>
267    ///A test for GetUser
268    ///</summary>
269    [TestMethod()]
270    public void GetUserTest() {
271      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
272      string username = string.Empty; // TODO: Initialize to an appropriate value
273      bool userIsOnline = false; // TODO: Initialize to an appropriate value
274      MembershipUser expected = null; // TODO: Initialize to an appropriate value
275      MembershipUser actual;
276      actual = target.GetUser(username, userIsOnline);
277      Assert.AreEqual(expected, actual);
278      Assert.Inconclusive("Verify the correctness of this test method.");
279    }
280
281    /// <summary>
282    ///A test for GetPassword
283    ///</summary>
284    [TestMethod()]
285    public void GetPasswordTest() {
286      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
287      string username = string.Empty; // TODO: Initialize to an appropriate value
288      string answer = string.Empty; // TODO: Initialize to an appropriate value
289      string expected = string.Empty; // TODO: Initialize to an appropriate value
290      string actual;
291      actual = target.GetPassword(username, answer);
292      Assert.AreEqual(expected, actual);
293      Assert.Inconclusive("Verify the correctness of this test method.");
294    }
295
296    /// <summary>
297    ///A test for GetNumberOfUsersOnline
298    ///</summary>
299    [TestMethod()]
300    public void GetNumberOfUsersOnlineTest() {
301      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
302      int expected = 0; // TODO: Initialize to an appropriate value
303      int actual;
304      actual = target.GetNumberOfUsersOnline();
305      Assert.AreEqual(expected, actual);
306      Assert.Inconclusive("Verify the correctness of this test method.");
307    }
308
309    /// <summary>
310    ///A test for GetAllUsers
311    ///</summary>
312    [TestMethod()]
313    public void GetAllUsersTest() {
314      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
315      int pageIndex = 0; // TODO: Initialize to an appropriate value
316      int pageSize = 0; // TODO: Initialize to an appropriate value
317      int totalRecords = 0; // TODO: Initialize to an appropriate value
318      int totalRecordsExpected = 0; // TODO: Initialize to an appropriate value
319      MembershipUserCollection expected = null; // TODO: Initialize to an appropriate value
320      MembershipUserCollection actual;
321      actual = target.GetAllUsers(pageIndex, pageSize, out totalRecords);
322      Assert.AreEqual(totalRecordsExpected, totalRecords);
323      Assert.AreEqual(expected, actual);
324      Assert.Inconclusive("Verify the correctness of this test method.");
325    }
326
327    /// <summary>
328    ///A test for FindUsersByName
329    ///</summary>
330    [TestMethod()]
331    public void FindUsersByNameTest() {
332      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
333      string usernameToMatch = string.Empty; // TODO: Initialize to an appropriate value
334      int pageIndex = 0; // TODO: Initialize to an appropriate value
335      int pageSize = 0; // TODO: Initialize to an appropriate value
336      int totalRecords = 0; // TODO: Initialize to an appropriate value
337      int totalRecordsExpected = 0; // TODO: Initialize to an appropriate value
338      MembershipUserCollection expected = null; // TODO: Initialize to an appropriate value
339      MembershipUserCollection actual;
340      actual = target.FindUsersByName(usernameToMatch, pageIndex, pageSize, out totalRecords);
341      Assert.AreEqual(totalRecordsExpected, totalRecords);
342      Assert.AreEqual(expected, actual);
343      Assert.Inconclusive("Verify the correctness of this test method.");
344    }
345
346    /// <summary>
347    ///A test for FindUsersByEmail
348    ///</summary>
349    [TestMethod()]
350    public void FindUsersByEmailTest() {
351      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
352      string emailToMatch = string.Empty; // TODO: Initialize to an appropriate value
353      int pageIndex = 0; // TODO: Initialize to an appropriate value
354      int pageSize = 0; // TODO: Initialize to an appropriate value
355      int totalRecords = 0; // TODO: Initialize to an appropriate value
356      int totalRecordsExpected = 0; // TODO: Initialize to an appropriate value
357      MembershipUserCollection expected = null; // TODO: Initialize to an appropriate value
358      MembershipUserCollection actual;
359      actual = target.FindUsersByEmail(emailToMatch, pageIndex, pageSize, out totalRecords);
360      Assert.AreEqual(totalRecordsExpected, totalRecords);
361      Assert.AreEqual(expected, actual);
362      Assert.Inconclusive("Verify the correctness of this test method.");
363    }
364
365    /// <summary>
366    ///A test for DeleteUser
367    ///</summary>
368    [TestMethod()]
369    public void DeleteUserTest() {
370      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
371      string username = string.Empty; // TODO: Initialize to an appropriate value
372      bool deleteAllRelatedData = false; // TODO: Initialize to an appropriate value
373      bool expected = false; // TODO: Initialize to an appropriate value
374      bool actual;
375      actual = target.DeleteUser(username, deleteAllRelatedData);
376      Assert.AreEqual(expected, actual);
377      Assert.Inconclusive("Verify the correctness of this test method.");
378    }
379
380    /// <summary>
381    ///A test for CreateUser
382    ///</summary>
383    [TestMethod()]
384    public void CreateUserTest() {
385      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
386      string username = string.Empty; // TODO: Initialize to an appropriate value
387      string password = string.Empty; // TODO: Initialize to an appropriate value
388      string email = string.Empty; // TODO: Initialize to an appropriate value
389      string passwordQuestion = string.Empty; // TODO: Initialize to an appropriate value
390      string passwordAnswer = string.Empty; // TODO: Initialize to an appropriate value
391      bool isApproved = false; // TODO: Initialize to an appropriate value
392      object providerUserKey = null; // TODO: Initialize to an appropriate value
393      MembershipCreateStatus status = new MembershipCreateStatus(); // TODO: Initialize to an appropriate value
394      MembershipCreateStatus statusExpected = new MembershipCreateStatus(); // TODO: Initialize to an appropriate value
395      MembershipUser expected = null; // TODO: Initialize to an appropriate value
396      MembershipUser actual;
397      actual = target.CreateUser(username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey, out status);
398      Assert.AreEqual(statusExpected, status);
399      Assert.AreEqual(expected, actual);
400      Assert.Inconclusive("Verify the correctness of this test method.");
401    }
402
403    /// <summary>
404    ///A test for ChangePasswordQuestionAndAnswer
405    ///</summary>
406    [TestMethod()]
407    public void ChangePasswordQuestionAndAnswerTest() {
408      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
409      string username = string.Empty; // TODO: Initialize to an appropriate value
410      string password = string.Empty; // TODO: Initialize to an appropriate value
411      string newPasswordQuestion = string.Empty; // TODO: Initialize to an appropriate value
412      string newPasswordAnswer = string.Empty; // TODO: Initialize to an appropriate value
413      bool expected = false; // TODO: Initialize to an appropriate value
414      bool actual;
415      actual = target.ChangePasswordQuestionAndAnswer(username, password, newPasswordQuestion, newPasswordAnswer);
416      Assert.AreEqual(expected, actual);
417      Assert.Inconclusive("Verify the correctness of this test method.");
418    }
419
420    /// <summary>
421    ///A test for ChangePassword
422    ///</summary>
423    [TestMethod()]
424    public void ChangePasswordTest() {
425      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
426      string username = string.Empty; // TODO: Initialize to an appropriate value
427      string oldPassword = string.Empty; // TODO: Initialize to an appropriate value
428      string newPassword = string.Empty; // TODO: Initialize to an appropriate value
429      bool expected = false; // TODO: Initialize to an appropriate value
430      bool actual;
431      actual = target.ChangePassword(username, oldPassword, newPassword);
432      Assert.AreEqual(expected, actual);
433      Assert.Inconclusive("Verify the correctness of this test method.");
434    }
435
436    /// <summary>
437    ///A test for HeuristicLabMembershipProvider Constructor
438    ///</summary>
439    [TestMethod()]
440    public void HeuristicLabMembershipProviderConstructorTest() {
441      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider();
442      Assert.Inconclusive("TODO: Implement code to verify target");
443    }
444  }
445}
Note: See TracBrowser for help on using the repository browser.