Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kenoir committed Sep 3, 2024
1 parent a5b0345 commit 40fd866
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ class SierraRulesForRequestingTest
)
}

it("blocks an item if fixed field 108 (status) is n,a,p or u") {
List("n","a","p").map { status =>
val item = createSierraItemDataWith(
fixedFields = Map("108" -> FixedField(label = "STATUS", value = status))
)

SierraRulesForRequesting(item) shouldBe a[NotRequestable.NeedsManualRequest]
}

val item = createSierraItemDataWith(
fixedFields = Map("108" -> FixedField(label = "STATUS", value = "u"))
)

SierraRulesForRequesting(item) shouldBe a[NotRequestable.ItemUnavailable]
}

it("does not block an item if fixed field 87 (loan rule) is zero") {
val item = createSierraItemDataWith(
fixedFields = Map("87" -> FixedField(label = "LOANRULE", value = "0"))
Expand Down

0 comments on commit 40fd866

Please sign in to comment.