Skip to content

Check Boundary Behavior

Run All Tests...

Make sure all the tests pass before you start.

Goal

Now that Hand instances are easier to work with, let's add missing tests ("backfill") for the Ace value handling code. (If you're not familiar with how Aces are valued, check the project's README file.)

Steps

Add two tests to the HandValueAceTest test class for these scenarios:

  1. Ace + 10 or Face Card (J/Q/K) should result in a total of 21 (Ace counts as 11)

  2. Ace + other cards adding to 12 should result in a total of 13 (Ace counts as 1)

What Did You Find?

These new tests may have revealed something, what is it?

Run All Tests...

Make sure all the tests pass when you are done.


You are done!