Stop throwing format exceptions when password hash isn't valid
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MileageTraker.Web.Utility;
|
||||
using System;
|
||||
using MileageTraker.Web.Utility;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Web.Tests.Membership
|
||||
@@ -22,5 +23,19 @@ namespace Web.Tests.Membership
|
||||
bool verifyHashedPassword = Crypto.VerifyHashedPassword(hashPassword, password);
|
||||
Assert.IsTrue(verifyHashedPassword);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void VerifyHashPassword_NotBase64Hash_Test()
|
||||
{
|
||||
bool verifyHashedPassword = Crypto.VerifyHashedPassword("notbase64", "not a password");
|
||||
Assert.IsFalse(verifyHashedPassword);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentNullException))]
|
||||
public void VerifyHashPassword_NullHash_Test()
|
||||
{
|
||||
Crypto.VerifyHashedPassword(null, "not a password");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user