mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-20 02:24:45 +00:00
resolutions 2; tests
This commit is contained in:
parent
3402ea2155
commit
c4bb0a77f6
|
|
@ -104,7 +104,7 @@ class BuildingTest extends Specification {
|
|||
class WarpGateTest extends Specification {
|
||||
"WarpGate" should {
|
||||
"construct" in {
|
||||
val bldg = WarpGate("Building", 0, 10, Zone.Nowhere, GlobalDefinitions.warpgate)
|
||||
val bldg = WarpGate("WarpGate", 0, 10, Zone.Nowhere, GlobalDefinitions.warpgate)
|
||||
bldg.MapId mustEqual 10
|
||||
bldg.Actor mustEqual ActorRef.noSender
|
||||
bldg.Amenities mustEqual Nil
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import net.psforever.objects.zones.{Zone, ZoneMap}
|
|||
import net.psforever.packet.game.{PlanetSideGUID, UseItemMessage}
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, Vector3}
|
||||
import org.specs2.mutable.Specification
|
||||
import services.{Service, ServiceManager}
|
||||
import services.ServiceManager
|
||||
import services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
|
||||
import scala.concurrent.duration._
|
||||
|
|
@ -108,7 +108,7 @@ class ResourceSiloControlNtuWarningTest extends ActorTest {
|
|||
obj.Actor = system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
obj.Actor ! "startup"
|
||||
val zone = new Zone("nowhere", new ZoneMap("nowhere-map"), 0)
|
||||
obj.Owner = new Building("Building", building_guid = 6, map_id = 0, Zone.Nowhere, StructureType.Building, GlobalDefinitions.building)
|
||||
obj.Owner = new Building("Building", building_guid = 6, map_id = 0, zone, StructureType.Building, GlobalDefinitions.building)
|
||||
val zoneEvents = TestProbe("zone-events")
|
||||
|
||||
"Resource silo" should {
|
||||
|
|
@ -139,7 +139,7 @@ class ResourceSiloControlUpdate1Test extends ActorTest {
|
|||
obj.Actor = system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
obj.Actor ! "startup"
|
||||
val zone = new Zone("nowhere", new ZoneMap("nowhere-map"), 0)
|
||||
val bldg = new Building("Building", building_guid = 6, map_id = 0, Zone.Nowhere, StructureType.Building, GlobalDefinitions.building)
|
||||
val bldg = new Building("Building", building_guid = 6, map_id = 0, zone, StructureType.Building, GlobalDefinitions.building)
|
||||
obj.Owner = bldg
|
||||
val zoneEvents = TestProbe("zone-events")
|
||||
val buildingEvents = TestProbe("building-events")
|
||||
|
|
@ -204,7 +204,7 @@ class ResourceSiloControlUpdate2Test extends ActorTest {
|
|||
obj.Actor = system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
obj.Actor ! "startup"
|
||||
val zone = new Zone("nowhere", new ZoneMap("nowhere-map"), 0)
|
||||
val bldg = new Building("Building", building_guid = 6, map_id = 0, Zone.Nowhere, StructureType.Building, GlobalDefinitions.building)
|
||||
val bldg = new Building("Building", building_guid = 6, map_id = 0, zone, StructureType.Building, GlobalDefinitions.building)
|
||||
obj.Owner = bldg
|
||||
val zoneEvents = TestProbe("zone-events")
|
||||
val buildingEvents = TestProbe("building-events")
|
||||
|
|
@ -222,8 +222,8 @@ class ResourceSiloControlUpdate2Test extends ActorTest {
|
|||
assert(obj.LowNtuWarningOn)
|
||||
obj.Actor ! ResourceSilo.UpdateChargeLevel(105)
|
||||
|
||||
val reply1 = zoneEvents.receiveOne(500 milliseconds)
|
||||
val reply2 = buildingEvents.receiveOne(500 milliseconds)
|
||||
val reply1 = zoneEvents.receiveOne(1000 milliseconds)
|
||||
val reply2 = buildingEvents.receiveOne(1000 milliseconds)
|
||||
assert(obj.ChargeLevel == 205)
|
||||
assert(obj.CapacitorDisplay == 3)
|
||||
assert(reply1.isInstanceOf[AvatarServiceMessage])
|
||||
|
|
@ -261,7 +261,7 @@ class ResourceSiloControlNoUpdateTest extends ActorTest {
|
|||
obj.Actor = system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
obj.Actor ! "startup"
|
||||
val zone = new Zone("nowhere", new ZoneMap("nowhere-map"), 0)
|
||||
val bldg = new Building("Building", building_guid = 6, map_id = 0, Zone.Nowhere, StructureType.Building, GlobalDefinitions.building)
|
||||
val bldg = new Building("Building", building_guid = 6, map_id = 0, zone, StructureType.Building, GlobalDefinitions.building)
|
||||
obj.Owner = bldg
|
||||
val zoneEvents = TestProbe("zone-events")
|
||||
val buildingEvents = TestProbe("building-events")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class BuildingBuilderTest extends ActorTest {
|
|||
"Building object" should {
|
||||
"build" in {
|
||||
val structure : (String, Int,Int,Zone,ActorContext)=>Building = Building.Structure(StructureType.Building)
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], structure, 10, 10, Zone.Nowhere), "building")
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], structure, "Building", 10, 10, Zone.Nowhere), "building")
|
||||
actor ! "!"
|
||||
|
||||
val reply = receiveOne(Duration.create(1000, "ms"))
|
||||
|
|
@ -33,7 +33,7 @@ class WarpGateBuilderTest extends ActorTest {
|
|||
"WarpGate object" should {
|
||||
"build" in {
|
||||
val structure : (String,Int,Int,Zone,ActorContext)=>Building = WarpGate.Structure
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], structure, 10, 10, Zone.Nowhere), "wgate")
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], structure, "wgate", 10, 10, Zone.Nowhere), "wgate")
|
||||
actor ! "!"
|
||||
|
||||
val reply = receiveOne(Duration.create(1000, "ms"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue