ModernUO/Projects/Server.Tests/Tests/Network/Packets/Outgoing/LightPacketTests.cs
Kamron Batman 0dc4acc164
fix(core): Removes implicit cast between Serial and uint (#728)
* Fixes spellbooks using serial ctor
* Fixes misc items where someone thought they had an amount and it didn't
* Fixes all `Food` types.
2021-08-25 00:27:19 -07:00

36 lines
1 KiB
C#

using System;
using Server.Network;
using Xunit;
namespace Server.Tests.Network
{
public class LightPacketTests
{
[Fact]
public void TestGlobalLightLevel()
{
byte lightLevel = 5;
var expected = new GlobalLightLevel(lightLevel).Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.SendGlobalLightLevel(lightLevel);
var result = ns.SendPipe.Reader.TryRead();
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
}
[Fact]
public void TestPersonalLightLevel()
{
Serial serial = (Serial)0x1024;
byte lightLevel = 5;
var expected = new PersonalLightLevel(serial, lightLevel).Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.SendPersonalLightLevel(serial, lightLevel);
var result = ns.SendPipe.Reader.TryRead();
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
}
}
}