2017-10-27 19:52:49 +02:00
|
|
|
module test.calendarwebapp.testpasshash;
|
|
|
|
|
|
|
|
import calendarwebapp.passhash;
|
|
|
|
|
|
|
|
import unit_threaded;
|
|
|
|
|
2017-11-10 18:20:55 +01:00
|
|
|
@("StubPasswordHasher")
|
2017-10-27 19:52:49 +02:00
|
|
|
@Values("", "test", "langesKompliziertesPasswort")
|
2017-11-10 18:20:55 +01:00
|
|
|
@safe unittest
|
2017-10-27 19:52:49 +02:00
|
|
|
{
|
2017-11-10 18:20:55 +01:00
|
|
|
immutable hasher = new StubPasswordHasher;
|
2017-10-27 19:52:49 +02:00
|
|
|
immutable testPassword = getValue!string;
|
|
|
|
hasher.checkHash(testPassword, hasher.generateHash(testPassword)).shouldBeTrue;
|
|
|
|
}
|
|
|
|
|
2017-11-10 18:20:55 +01:00
|
|
|
@("SHA256PasswordHasher")
|
2017-10-27 19:52:49 +02:00
|
|
|
@Values("", "test", "langesKompliziertesPasswort")
|
|
|
|
@safe unittest
|
|
|
|
{
|
2017-11-10 18:20:55 +01:00
|
|
|
immutable hasher = new SHA256PasswordHasher;
|
2017-10-27 19:52:49 +02:00
|
|
|
immutable testPassword = getValue!string;
|
|
|
|
hasher.checkHash(testPassword, hasher.generateHash(testPassword)).shouldBeTrue;
|
|
|
|
}
|