Fix bad serials (#304)
- [X] Fixes bad serial calculations - [X] Tightens HexStrings Bumps release version Updates documentation
This commit is contained in:
parent
b0c1076cb5
commit
ae436cb55f
46 changed files with 76 additions and 51 deletions
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace Server.Tests.Accounting
|
||||
{
|
||||
public class HexStringConverterTest
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("ABCDEF1234", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
||||
public void TestGetBytes(string input, byte[] bytes)
|
||||
{
|
||||
Span<byte> outputBytes = stackalloc byte[input.Length / 2];
|
||||
HexStringConverter.GetBytes(input, outputBytes);
|
||||
|
||||
Assert.Equal(bytes, outputBytes.ToArray());
|
||||
Assert.Equal(input, bytes.ToHexString());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("[AB, CD, EF, 12, 34]", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
||||
public void TestsGetStringDelimited(string expected, byte[] bytes)
|
||||
{
|
||||
Assert.Equal(expected, bytes.ToDelimitedHexString());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue