Formats UO Content (#201)
This commit is contained in:
parent
86b7b3aed1
commit
ad3775c4d7
3249 changed files with 431083 additions and 440981 deletions
|
|
@ -1,31 +1,31 @@
|
|||
using System;
|
||||
using System.Buffers;
|
||||
using Server.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace Server.Tests.Network.Packets
|
||||
{
|
||||
public class ObjectHelpResponseTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestObjectHelpResponse()
|
||||
{
|
||||
Serial s = 0x100;
|
||||
string text = "This is some testing text";
|
||||
|
||||
Span<byte> data = new ObjectHelpResponse(s, text).Compile();
|
||||
|
||||
int length = 9 + text.Length * 2;
|
||||
|
||||
Span<byte> expectedData = stackalloc byte[length];
|
||||
int pos = 0;
|
||||
|
||||
expectedData.Write(ref pos, (byte)0xB7); // Packet ID
|
||||
expectedData.Write(ref pos, (ushort)length); // Length
|
||||
expectedData.Write(ref pos, s);
|
||||
expectedData.WriteBigUniNull(ref pos, text);
|
||||
|
||||
AssertThat.Equal(data, expectedData);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using Server.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace Server.Tests.Network.Packets
|
||||
{
|
||||
public class ObjectHelpResponseTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestObjectHelpResponse()
|
||||
{
|
||||
Serial s = 0x100;
|
||||
var text = "This is some testing text";
|
||||
|
||||
var data = new ObjectHelpResponse(s, text).Compile();
|
||||
|
||||
var length = 9 + text.Length * 2;
|
||||
|
||||
Span<byte> expectedData = stackalloc byte[length];
|
||||
var pos = 0;
|
||||
|
||||
expectedData.Write(ref pos, (byte)0xB7); // Packet ID
|
||||
expectedData.Write(ref pos, (ushort)length); // Length
|
||||
expectedData.Write(ref pos, s);
|
||||
expectedData.WriteBigUniNull(ref pos, text);
|
||||
|
||||
AssertThat.Equal(data, expectedData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue