Beispiel #1
0
    public void CreateFire_SendsExpectedPacket()
    {
        var mtaServer = new TestingServer();
        var player    = mtaServer.AddFakePlayer();

        var service = new FireService(mtaServer);

        service.CreateFire(Vector3.Zero, 2);

        var expectedPacket = new FirePacket(Vector3.Zero, 2);

        mtaServer.VerifyPacketSent(Packets.Enums.PacketId.PACKET_ID_FIRE, player, expectedPacket.Write());
    }
Beispiel #2
0
    public void CreateFire_BroadcastsFirePacket()
    {
        var mtaServer = new TestingServer();
        var players   = new TestingPlayer[] {
            mtaServer.AddFakePlayer(),
            mtaServer.AddFakePlayer(),
            mtaServer.AddFakePlayer(),
        };

        var service = new FireService(mtaServer);

        service.CreateFire(Vector3.Zero);

        foreach (var player in players)
        {
            mtaServer.VerifyPacketSent(Packets.Enums.PacketId.PACKET_ID_FIRE, player);
        }
    }