2023-03-13 18:36:59 +02:00
|
|
|
|
// Copyright (c) 2020 Tudor Stanciu
|
|
|
|
|
|
|
|
|
|
using Tuitio.Application.Services;
|
2023-03-10 20:11:11 +02:00
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Tuitio.Application.Tests
|
|
|
|
|
{
|
|
|
|
|
public class HashingServiceTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void HashSha256_ShouldReturnCorrectHash()
|
|
|
|
|
{
|
|
|
|
|
// Arrange
|
|
|
|
|
var expected = "9B8769A4A742959A2D0298C36FB70623F2DFACDA8436237DF08D8DFD5B37374C";
|
|
|
|
|
var hashingService = new HashingService();
|
|
|
|
|
|
|
|
|
|
// Act
|
|
|
|
|
var actual = hashingService.HashSha256("pass123");
|
|
|
|
|
|
|
|
|
|
// Assert
|
|
|
|
|
Assert.Equal(expected, actual);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|