Adds User Component
This commit is contained in:
parent
73a1f11e99
commit
69758735de
14 changed files with 222 additions and 65 deletions
|
|
@ -1,10 +1,10 @@
|
|||
using System.Diagnostics;
|
||||
using Sodium;
|
||||
using PlanTempus.Core.Entities.Users;
|
||||
using PlanTempus.Core;
|
||||
|
||||
namespace PlanTempus.Tests
|
||||
{
|
||||
[TestClass]
|
||||
[TestClass]
|
||||
public class PasswordHasherTests : TestFixture
|
||||
{
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ namespace PlanTempus.Tests
|
|||
string password = "TestPassword123";
|
||||
|
||||
// Act
|
||||
string hashedPassword = PasswordHasher.HashPassword(password);
|
||||
string hashedPassword = new SecureTokenizer().TokenizeText(password);
|
||||
string[] parts = hashedPassword.Split('.');
|
||||
|
||||
// Assert
|
||||
|
|
@ -48,10 +48,10 @@ namespace PlanTempus.Tests
|
|||
{
|
||||
// Arrange
|
||||
string password = "TestPassword123";
|
||||
string hashedPassword = PasswordHasher.HashPassword(password);
|
||||
string hashedPassword = new SecureTokenizer().TokenizeText(password);
|
||||
|
||||
// Act
|
||||
bool result = PasswordHasher.VerifyPassword(hashedPassword, password);
|
||||
bool result = new SecureTokenizer().VerifyToken(hashedPassword, password);
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(result);
|
||||
|
|
@ -63,10 +63,10 @@ namespace PlanTempus.Tests
|
|||
// Arrange
|
||||
string correctPassword = "TestPassword123";
|
||||
string wrongPassword = "WrongPassword123";
|
||||
string hashedPassword = PasswordHasher.HashPassword(correctPassword);
|
||||
string hashedPassword = new SecureTokenizer().TokenizeText(correctPassword);
|
||||
|
||||
// Act
|
||||
bool result = PasswordHasher.VerifyPassword(hashedPassword, wrongPassword);
|
||||
bool result = new SecureTokenizer().VerifyToken(hashedPassword, wrongPassword);
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(result);
|
||||
|
|
@ -80,7 +80,7 @@ namespace PlanTempus.Tests
|
|||
string invalidHash = "InvalidHash";
|
||||
|
||||
// Act
|
||||
bool result = PasswordHasher.VerifyPassword(invalidHash, password);
|
||||
bool result = new SecureTokenizer().VerifyToken(invalidHash, password);
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue