mirror of
https://github.com/kwsch/NHSE.git
synced 2026-04-12 11:46:01 -05:00
22 lines
549 B
C#
22 lines
549 B
C#
using FluentAssertions;
|
|
using NHSE.Core;
|
|
using Xunit;
|
|
|
|
namespace NHSE.Tests
|
|
{
|
|
public class EncryptedIntTests
|
|
{
|
|
[Fact]
|
|
public void TestParse()
|
|
{
|
|
const int expect = 31_280;
|
|
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);
|
|
}
|
|
}
|
|
}
|