public void TestThatGetHashMethodWorkdCorrectly() { using (var sha = SHA256.Create()) { var cryphographyService = new CryphographyService(); Assert.AreEqual(PasswordHash, cryphographyService.GetHash(sha, Password)); } }
public void TestThatVerifyMethodWorkdCorrectly() { using (var sha = SHA256.Create()) { var cryphographyService = new CryphographyService(); Assert.IsTrue(cryphographyService.VerifyHash(sha, "KronosTest", PasswordHash)); Assert.IsFalse(cryphographyService.VerifyHash(sha, "WrongPassword", PasswordHash)); } }