public static WaitForPacket ( |
||
client | ||
Результат | string |
public void TestCharacterOption() { // login, create character, start game FakeNetworkClient client = HandlerTestHelper.InitializeTestEnvironment(); CharacterOptionPacket optionPacket = new CharacterOptionPacket { IsActive = false, Option = CharacterOption.FamilyRequestBlocked }; // check family request client.ReceivePacket(optionPacket); string msgPacket = HandlerTestHelper.WaitForPacket(client, "msg"); Assert.IsTrue(client.Session.Character.FamilyRequestBlocked); HandlerTestHelper.ShutdownTestingEnvironment(); Assert.Pass(); }
public void TestWalkMove() { // login, create character, start game FakeNetworkClient client = HandlerTestHelper.InitializeTestEnvironment(); WalkPacket walkPacket = new WalkPacket { Speed = 11, XCoordinate = 89, YCoordinate = 126 }; // send walkpacket to client client.ReceivePacket(walkPacket); string mvPacket = HandlerTestHelper.WaitForPacket(client, "mv"); MovePacket movePacket = PacketFactory.Deserialize <MovePacket>(mvPacket); Assert.AreEqual(walkPacket.XCoordinate, movePacket.PositionX); Assert.AreEqual(walkPacket.YCoordinate, movePacket.PositionY); Assert.AreEqual(walkPacket.Speed, movePacket.Speed); HandlerTestHelper.ShutdownTestingEnvironment(); Assert.Pass(); }