27 lines
620 B
C#
27 lines
620 B
C#
using MileageTraker.Web.Membership;
|
|
using NUnit.Framework;
|
|
|
|
namespace Web.Tests.Membership
|
|
{
|
|
[TestFixture]
|
|
public class CryptoTests
|
|
{
|
|
[Test]
|
|
public void HashPassword_Test()
|
|
{
|
|
const string password = "1da";
|
|
var hashPassword = Crypto.HashPassword(password);
|
|
Assert.That(hashPassword, Is.Not.EqualTo(password));
|
|
}
|
|
|
|
[Test]
|
|
public void VerifyHashPassword_Test()
|
|
{
|
|
const string password = "1daFH2k1jv!3dsa";
|
|
var hashPassword = Crypto.HashPassword(password);
|
|
bool verifyHashedPassword = Crypto.VerifyHashedPassword(hashPassword, password);
|
|
Assert.IsTrue(verifyHashedPassword);
|
|
}
|
|
}
|
|
}
|