Files
monorepo/LCU.API.Internal.OnlineLoanApp/OnlineBankingAuth.Tests/CookieCrytorTest.cs
T
2026-03-11 11:18:25 -05:00

22 lines
698 B
C#

using Xunit;
using Landmark.OLA.Application.Common.Security;
namespace OnlineBankingAuth.Tests
{
public class CookieCrytorTest
{
[Fact]
public void EncryptAndDecrypt()
{
var sampleUnencryptedString = "This string will be encrypted and decrypted in this test";
var secret = "A secret to serve as a key in our symmetric encryption";
var encrypted = CookieCryptor.EncryptJwt(sampleUnencryptedString, secret);
Assert.NotEqual(sampleUnencryptedString, encrypted);
var decrypted = CookieCryptor.DecryptJwt(encrypted, secret);
Assert.Equal(sampleUnencryptedString, decrypted);
}
}
}