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

@ -16,6 +16,14 @@ class NumberPoolTest extends Specification {
ok
}
"fail to construct 1 (number less than zero)" in {
new SimplePool(-1 :: Nil) must throwA[IllegalArgumentException]
}
"fail to construct 2 (duplicate numbers)" in {
new SimplePool(1 :: 1 :: Nil) must throwA[IllegalArgumentException]
}
"get a number" in {
val obj = new SimplePool((0 to 10).toList)
obj.Get() match {
@ -26,6 +34,13 @@ class NumberPoolTest extends Specification {
}
}
"used number count is always zero" in {
val obj = new SimplePool((0 to 10).toList)
obj.Count mustEqual 0
obj.Get()
obj.Count mustEqual 0
}
"return a number" in {
//returning a number for a SimplePool is actually just a way of checking that the number is in the "pool" at all
val obj = new SimplePool((0 to 10).toList)