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