Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
        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);
        }
Beispiel #9
0
        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);
        }
Beispiel #10
0
        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);
        }
Beispiel #11
0
        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);
        }
Beispiel #12
0
        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);
        }
Beispiel #13
0
        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);
        }
Beispiel #14
0
        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);
        }
Beispiel #15
0
        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);
        }
Beispiel #16
0
        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);
        }
Beispiel #17
0
        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);
        }
Beispiel #18
0
        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);
        }
Beispiel #19
0
        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);
        }
Beispiel #20
0
        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);
        }
Beispiel #21
0
        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);
        }
Beispiel #22
0
        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);
        }
Beispiel #23
0
        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);
        }
Beispiel #24
0
        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);
        }
Beispiel #25
0
        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);
        }
Beispiel #26
0
        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);
        }
Beispiel #27
0
        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);
        }
Beispiel #28
0
        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);
        }
Beispiel #29
0
        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);
        }
Beispiel #30
0
        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);
        }