mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-24 06:19:07 +00:00
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:
parent
0e5afe6cfd
commit
3aee0ab4e8
69 changed files with 4534 additions and 3037 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue