CultLib/tests/GameCult.Networking.Tests/NetworkingTests.cs

18 lines
503 B
C#
Raw Normal View History

2026-04-18 06:04:39 +01:00
using System.Text;
using NUnit.Framework;
namespace GameCult.Networking.Tests
{
public class NetworkingTests
{
[Test]
public void EncryptDecrypt_Roundtrip()
{
var plaintext = Encoding.UTF8.GetBytes("test");
var nonce = Secret.NewNonce;
var encrypted = Secret.EncryptBytes(plaintext, nonce);
var decrypted = Secret.DecryptBytes(encrypted, nonce);
Assert.That(plaintext, Is.EqualTo(decrypted));
}
}
}