fix(test): update AppraiseTests.ParsePutObjInContainer_RoundTrip for 4-field parser
Task 7 extended ParsePutObjInContainer to require 16 bytes (added ContainerType as the 4th field). The pre-existing AppraiseTests round-trip test built only 12 bytes (old 3-field layout), so it returned null and failed. Update the test to supply 16 bytes and also assert ContainerType. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
275319461e
commit
a69c733e6e
1 changed files with 7 additions and 4 deletions
|
|
@ -56,15 +56,18 @@ public sealed class AppraiseTests
|
|||
[Fact]
|
||||
public void ParsePutObjInContainer_RoundTrip()
|
||||
{
|
||||
byte[] payload = new byte[12];
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload, 0x1001u);
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload.AsSpan(4), 0x2001u);
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload.AsSpan(8), 3u);
|
||||
// 4 fields (Task 7 fix: containerType added) — 16 bytes required.
|
||||
byte[] payload = new byte[16];
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload, 0x1001u);
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload.AsSpan(4), 0x2001u);
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload.AsSpan(8), 3u);
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload.AsSpan(12), 1u); // containerType
|
||||
|
||||
var parsed = GameEvents.ParsePutObjInContainer(payload);
|
||||
Assert.NotNull(parsed);
|
||||
Assert.Equal(0x1001u, parsed!.Value.ItemGuid);
|
||||
Assert.Equal(0x2001u, parsed.Value.ContainerGuid);
|
||||
Assert.Equal(3u, parsed.Value.Placement);
|
||||
Assert.Equal(1u, parsed.Value.ContainerType);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue