added and expanded tests in hopes of increasing code coverage score

added tests for AvatarService and PacketCodingActor; especially PCA tests
This commit is contained in:
FateJH 2017-12-05 00:37:24 -05:00
parent 0e5afe6cfd
commit 3aee0ab4e8
69 changed files with 4534 additions and 3037 deletions

View file

@ -3,6 +3,7 @@ package objects.number
import net.psforever.objects.guid.AvailabilityPolicy
import net.psforever.objects.guid.key.{LoanedKey, SecureKey}
import net.psforever.packet.game.PlanetSideGUID
import org.specs2.mutable.Specification
class NumberSourceTest extends Specification {
@ -102,6 +103,17 @@ class NumberSourceTest extends Specification {
result2.get.Object mustEqual Some(test)
}
"return a secure key" in {
val obj = LimitedNumberSource(25)
val test = new TestClass()
val result1 : Option[LoanedKey] = obj.Available(5)
result1.get.Object = test
test.GUID = PlanetSideGUID(5)
val result2 : Option[SecureKey] = obj.Get(5)
obj.Return(result2.get) mustEqual Some(test)
}
"restrict a previously-assigned number" in {
val obj = LimitedNumberSource(25)
val test = new TestClass()