Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/26/10 11:52:44 (14 years ago)
Author:
jhaider
Message:

added ValidateUserTestEncrypted edited ValidateUserTest (#1046)

File:
1 edited

Legend:

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

    r3956 r3961  
    11using System;
     2using System.Collections.Specialized;
    23using Service.Provider;
    34using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    189190    [TestMethod()]
    190191    public void ValidateUserTest() {
    191       HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider(); // TODO: Initialize to an appropriate value
    192       string username = string.Empty; // TODO: Initialize to an appropriate value
    193       string password = string.Empty; // TODO: Initialize to an appropriate value
    194       bool expected = false; // TODO: Initialize to an appropriate value
    195       bool actual;
    196       actual = target.ValidateUser(username, password);
    197       Assert.AreEqual(expected, actual);
    198       Assert.Inconclusive("Verify the correctness of this test method.");
     192      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider();
     193      MembershipCreateStatus status;
     194      target.CreateUser("testname", "newPassword", "testemail", "testquestion", "testanswer", true, null, out status);
     195      Assert.IsTrue(target.ValidateUser("testname", "newPassword"));
     196    }
     197
     198    /// <summary>
     199    ///A test for ValidateUser
     200    ///</summary>
     201    [TestMethod()]
     202    public void ValidateUserTestEncrypted() {
     203      HeuristicLabMembershipProvider target = new HeuristicLabMembershipProvider();
     204      NameValueCollection  config = new NameValueCollection();
     205      config.Add("passwordFormat", "Encrypted");
     206      target.Initialize("",config);
     207      MembershipCreateStatus status;
     208      target.CreateUser("testname", "newPassword", "testemail", "testquestion", "testanswer", true, null, out status);
     209      Assert.IsTrue(target.ValidateUser("testname", "newPassword"));
    199210    }
    200211
Note: See TracChangeset for help on using the changeset viewer.