PSF-LoginServer/common/src/test/scala/game/ContinentalLockUpdateMessageTest.scala
Fate-JH 6001446cd5 Split Up GamePacketTest (#102)
* split up GamePacketTest into separate testing files

* PR wants this file?
2017-03-04 10:06:10 -05:00

29 lines
786 B
Scala

// Copyright (c) 2016 PSForever.net to present
package game
import org.specs2.mutable._
import net.psforever.packet._
import net.psforever.packet.game._
import net.psforever.types.PlanetSideEmpire
import scodec.bits._
class ContinentalLockUpdateMessageTest extends Specification {
val string = hex"A8 16 00 40"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case ContinentalLockUpdateMessage(continent_guid, empire) =>
continent_guid mustEqual PlanetSideGUID(22)
empire mustEqual PlanetSideEmpire.NC
case _ =>
ko
}
}
"encode" in {
val msg = ContinentalLockUpdateMessage(PlanetSideGUID(22), PlanetSideEmpire.NC)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
}