Formats UO Content (#201)
This commit is contained in:
parent
86b7b3aed1
commit
ad3775c4d7
3249 changed files with 431083 additions and 440981 deletions
|
|
@ -1,37 +1,37 @@
|
|||
using System;
|
||||
using System.Buffers;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
using Xunit;
|
||||
|
||||
namespace Server.Tests.Network.Packets
|
||||
{
|
||||
internal class TestPrompt : Prompt
|
||||
{
|
||||
}
|
||||
|
||||
public class UnicodePromptTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestUnicodePrompt()
|
||||
{
|
||||
var prompt = new TestPrompt();
|
||||
Span<byte> data = new UnicodePrompt(prompt).Compile();
|
||||
|
||||
Span<byte> expectedData = stackalloc byte[21];
|
||||
int pos = 0;
|
||||
|
||||
expectedData.Write(ref pos, (byte)0xC2); // Packet ID
|
||||
expectedData.Write(ref pos, (ushort)0x15); // Length
|
||||
expectedData.Write(ref pos, prompt.Serial);
|
||||
expectedData.Write(ref pos, prompt.Serial);
|
||||
|
||||
#if NO_LOCAL_INIT
|
||||
expectedData.Write(ref pos, (ulong)0);
|
||||
expectedData.Write(ref pos, (ushort)0);
|
||||
#endif
|
||||
|
||||
AssertThat.Equal(data, expectedData);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
using Xunit;
|
||||
|
||||
namespace Server.Tests.Network.Packets
|
||||
{
|
||||
internal class TestPrompt : Prompt
|
||||
{
|
||||
}
|
||||
|
||||
public class UnicodePromptTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestUnicodePrompt()
|
||||
{
|
||||
var prompt = new TestPrompt();
|
||||
var data = new UnicodePrompt(prompt).Compile();
|
||||
|
||||
Span<byte> expectedData = stackalloc byte[21];
|
||||
var pos = 0;
|
||||
|
||||
expectedData.Write(ref pos, (byte)0xC2); // Packet ID
|
||||
expectedData.Write(ref pos, (ushort)0x15); // Length
|
||||
expectedData.Write(ref pos, prompt.Serial);
|
||||
expectedData.Write(ref pos, prompt.Serial);
|
||||
|
||||
#if NO_LOCAL_INIT
|
||||
expectedData.Write(ref pos, (ulong)0);
|
||||
expectedData.Write(ref pos, (ushort)0);
|
||||
#endif
|
||||
|
||||
AssertThat.Equal(data, expectedData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue