public void TestNullFastwalkStack() { var expected = new NullFastwalkStack().Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendInitialFastwalkStack(new uint[] { 0, 0, 0, 0, 0, 0 }); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestSpeedControl(byte speedControl) { var expected = new SpeedControl(speedControl).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendSpeedControl((SpeedControlSetting)speedControl); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestCancelArrow() { var expected = new CancelArrow().Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendCancelArrow(0, 0, Serial.Zero); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestCloseGump(int typeId, int buttonId) { var expected = new CloseGump(typeId, buttonId).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendCloseGump(typeId, buttonId); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestSpecialAbility(int abilityId, bool active) { var expected = new ToggleSpecialAbility(abilityId, active).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendToggleSpecialAbility(abilityId, active); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestLiftRej(LRReason reason) { var expected = new LiftRej(reason).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendLiftReject(reason); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestDeathStatus(bool dead) { var expected = new DeathStatus(dead).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendDeathStatus(dead); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestClearAbility() { var expected = new ClearWeaponAbility().Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendClearWeaponAbility(); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestPopupMessage() { var expected = new PopupMessage(PMMessage.LoginSyncError).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendPopupMessage(PMMessage.LoginSyncError); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestSetWarMode(bool warmode) { var expected = new SetWarMode(warmode).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendSetWarMode(warmode); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestScreenEffect(ScreenEffectType screenType) { var expected = new ScreenEffect(screenType).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendScreenEffect(screenType); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestChangeUpdateRange(int range) { var expected = new ChangeUpdateRange(range).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendChangeUpdateRange((byte)range); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestPlayMusic(MusicName music) { var expected = new PlayMusic(music).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendPlayMusic(music); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestScrollMessage(int type, int tip, string text) { var expected = new ScrollMessage(type, tip, text).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendScrollMessage(type, tip, text); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestSeasonChange(int season, bool playSound) { var expected = new SeasonChange(season, playSound).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendSeasonChange((byte)season, playSound); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestDisplayPaperdoll(uint m, string title, bool warmode, bool canLift) { var expected = new DisplayPaperdoll(m, title, warmode, canLift).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendDisplayPaperdoll(m, title, warmode, canLift); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestSequence(byte num) { var expected = new Sequence(num).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendSequence(num); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestLaunchBrowser(string uri) { var expected = new LaunchBrowser(uri).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendLaunchBrowser(uri); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestDeleteResult() { var expected = new DeleteResult(DeleteResultType.BadRequest).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendCharacterDeleteResult(DeleteResultType.BadRequest); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestWeather(int type, int density, int temp) { var expected = new Weather(type, density, temp).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendWeather((byte)type, (byte)density, (byte)temp); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestPingAck(byte ping) { var expected = new PingAck(ping).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendPingAck(ping); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestInvalidMapEnable() { var expected = new InvalidMapEnable().Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendInvalidMap(); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestSetArrow(int x, int y) { var expected = new SetArrow(x, y).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendSetArrow(x, y, Serial.Zero); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestMapPatches() { var expected = new MapPatches().Compile(); var ns = PacketTestUtilities.CreateTestNetState(); ns.SendMapPatches(); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestPathfindMessage(int x, int y, int z) { var p = new Point3D(x, y, z); var expected = new PathfindMessage(p).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendPathfindMessage(p); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestCurrentTime(int hour, int minute, int second) { var date = new DateTime(2020, 1, 1, hour, minute, second); var expected = new CurrentTime(date).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendCurrentTime(date); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestTargetReq() { var t = new TestTarget(10, true, TargetFlags.Beneficial); var expected = new TargetReq(t).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendTargetReq(t); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestRemoveEntity() { Serial e = 0x1000; var expected = new RemoveEntity(e).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendRemoveEntity(e); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestDisplayProfile(uint serial, string header, string body, string footer) { Serial m = serial; var expected = new DisplayProfile(m, header, body, footer).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendDisplayProfile(m, header, body, footer); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestAccountLoginRej() { var reason = ALRReason.BadComm; var expected = new AccountLoginRej(reason).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendAccountLoginRejected(reason); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }