mirror of
https://github.com/modernuo/ModernUO
synced 2026-08-11 22:23:06 -04:00
- [X] Adds ability to create new protocol extension packets - [X] Adds freeshard protocol extension support (packet 0xF1) - [X] Adds ConnectUO support - [X] Adds arbitrary read for `CircularBufferReader` and `SpanReader`
25 lines
779 B
C#
25 lines
779 B
C#
using System;
|
|
using Server.Text;
|
|
using Xunit;
|
|
|
|
namespace Server.Tests
|
|
{
|
|
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];
|
|
input.GetBytes(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());
|
|
}
|
|
}
|
|
}
|