Skip to content

Commit

Permalink
Add tests with default services
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin.lesage committed Apr 12, 2024
1 parent cc1e718 commit 098c081
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,27 @@ class HardwareTest extends AnyFlatSpec with should.Matchers {
}

it should "have no services when specified" in {
val t: Target = Target(withDefaultServices=false)
val s: SimpleTransporter = SimpleTransporter(withDefaultServices=false)
val i: Initiator = Initiator(withDefaultServices=false)
val v: Virtualizer = Virtualizer(withDefaultServices=false)
val t: Target = Target(withDefaultServices = false)
val s: SimpleTransporter = SimpleTransporter(withDefaultServices = false)
val i: Initiator = Initiator(withDefaultServices = false)
val v: Virtualizer = Virtualizer(withDefaultServices = false)

for (h <- List(t, s, i, v)) {
h.services shouldBe empty
}
}

it should "have only specified services when specified" in {
val t: Target = Target(Set(Load("a"), Load("b")), false)
t.services.size shouldEqual 2
exactly(2, t.services) shouldBe a [Load]

val s = Target(Set(Store("a")), false)
s.services.size shouldEqual 1
exactly(1, s.services) shouldBe a[Store]

val i = Target(Set.empty, false)
i.services.size shouldEqual 0
}

}

0 comments on commit 098c081

Please sign in to comment.