- fix: auth renew and null fix

This commit is contained in:
2025-11-08 13:42:11 +03:00
parent a09ace0d39
commit f44589454c
13 changed files with 241 additions and 68 deletions

View File

@@ -0,0 +1,24 @@
using Nebula.Shared.Utils;
namespace Nebula.UnitTest.NebulaSharedTests;
[TestFixture]
[TestOf(typeof(CryptographicStore))]
public class CryptographicTest
{
[Test]
public async Task EncryptDecrypt()
{
var key = CryptographicStore.GetComputerKey();
Console.WriteLine($"Key: {key}");
var entry = new TestEncryptEntry("Hello", "World");
Console.WriteLine($"Raw data: {entry}");
var encrypt = CryptographicStore.Encrypt(entry, key);
Console.WriteLine($"Encrypted data: {encrypt}");
var decrypt = await CryptographicStore.Decrypt<TestEncryptEntry>(encrypt, key);
Console.WriteLine($"Decrypted data: {decrypt}");
Assert.That(decrypt, Is.EqualTo(entry));
}
}
public record struct TestEncryptEntry(string Key, string Value);