NHSE/NHSE.Tests/EncryptedIntTests.cs
Kurt b88c518d5c
Update FieldItemEditor for 3.0.0 (#716)
Updates the Field Item Editor to render layers based on the entire map, and the per-patch positioning of each layer.
Import/export will gracefully handle upgrade/downgrade, and viewport import/export will gracefully update tiles rather than a per-acre basis.

Performance has also been slightly improved; no allocation is done anymore when updating the image.
2026-01-25 16:55:38 -06:00

21 lines
534 B
C#

using System;
using FluentAssertions;
using NHSE.Core;
using Xunit;
namespace NHSE.Tests;
public static class EncryptedIntTests
{
[Fact]
public static void TestParse()
{
const int expect = 31_280;
ReadOnlySpan<byte> data = [0x8A, 0xC4, 0xE3, 0xCF, 0x37, 0xD5, 0x1A, 0xD3];
var val = EncryptedInt32.ReadVerify(data, 0);
val.Value.Should().Be(expect);
var encode = EncryptedInt32.Encrypt(expect, val.Shift, val.Adjust);
val.OriginalEncrypted.Should().Be(encode);
}
}