{
  "fixtureId": "fixture-library-checkout",
  "contractName": "canCheckoutBook(isAvailable, borrowedCount)",
  "lessonIds": [
    "write-boundary-example-by-hand",
    "build-library-checkout-checker"
  ],
  "invalidInputPolicy": "isAvailable must be boolean and borrowedCount must be integer >= 0; invalid values return INVALID_CHECKOUT_INPUT.",
  "cases": [
    {
      "caseId": "lib-typical-ok",
      "kind": "typical",
      "input": {
        "isAvailable": true,
        "borrowedCount": 2
      },
      "expected": true,
      "reason": "Book is on shelf and reader is below the 3-book limit."
    },
    {
      "caseId": "lib-limit-boundary",
      "kind": "boundary",
      "input": {
        "isAvailable": true,
        "borrowedCount": 3
      },
      "expected": false,
      "reason": "Reader already holds 3 books; strict < 3 limit declines checkout.",
      "catchesBug": "Catches <= 3 off-by-one bug."
    },
    {
      "caseId": "lib-unavailable",
      "kind": "typical",
      "input": {
        "isAvailable": false,
        "borrowedCount": 0
      },
      "expected": false,
      "reason": "Unavailable book cannot be checked out even with 0 borrowed.",
      "catchesBug": "Catches missing availability check."
    },
    {
      "caseId": "lib-both-fail",
      "kind": "typical",
      "input": {
        "isAvailable": false,
        "borrowedCount": 3
      },
      "expected": false,
      "reason": "Both conditions fail together."
    },
    {
      "caseId": "lib-invalid-neg",
      "kind": "invalid",
      "input": {
        "isAvailable": true,
        "borrowedCount": -1
      },
      "expectedError": "INVALID_CHECKOUT_INPUT",
      "reason": "Negative borrowed count is impossible.",
      "catchesBug": "Catches missing negative-count validation."
    }
  ]
}
