Changeset 3961
- Timestamp:
- 06/26/10 11:52:44 (14 years ago)
- Location:
- branches/HeuristicLab.Services.Authentication Prototype
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabMembershipProvider.cs
r3958 r3961 21 21 private int pPasswordAttemptWindow; 22 22 private int pMinRequiredPasswordLength; 23 private MembershipPasswordFormat pPasswordFormat ;23 private MembershipPasswordFormat pPasswordFormat = MembershipPasswordFormat.Clear; 24 24 private MachineKeySection machineKey; 25 25 … … 33 33 throw new ArgumentNullException("config"); 34 34 35 if ( name == null|| name.Length == 0)35 if (string.IsNullOrEmpty(name) || name.Length == 0) 36 36 name = "HeuristicLabMembershipProvider"; 37 37 … … 55 55 string tempFormat = config["passwordFormat"]; 56 56 if (tempFormat == null) { 57 tempFormat = " Hashed";57 tempFormat = "Clear"; 58 58 } 59 59 … … 257 257 258 258 public override MembershipPasswordFormat PasswordFormat { 259 get { throw new NotImplementedException(); }259 get { return pPasswordFormat; } 260 260 } 261 261 -
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabMembershipProviderTest.cs
r3956 r3961 1 1 using System; 2 using System.Collections.Specialized; 2 3 using Service.Provider; 3 4 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 189 190 [TestMethod()] 190 191 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")); 199 210 } 200 211
Note: See TracChangeset
for help on using the changeset viewer.