• deadbeef79000@lemmy.nz
    link
    fedilink
    arrow-up
    15
    ·
    edit-2
    2 months ago

    This is why it’s important to have tests that assert a system’s failure modes too.

    shouldFitTriangleInTriangleHole()

    shouldNotFitTriangleInAnyOtherHoles()

    Bonus points for just parameterizing it.

    • Elvith Ma'for@feddit.org
      link
      fedilink
      arrow-up
      4
      ·
      2 months ago
       assert triangleObject.shouldFitInHole(triangleHole) == true
      
      assert triangleObject.shouldFitInHole(squareHole) == false