Commit 1b2f487f authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch5] Test code updated to the code on p 103

parent 95c82f1b
Loading
Loading
Loading
Loading
+7 −1
Changes for src/main/java/ch5/SimpleStartupTestDrive.java: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -3,11 +3,17 @@ package ch5;
public class SimpleStartupTestDrive {
  public static void main(String[] args) {
    SimpleStartup dot = new SimpleStartup();

    int[] locations = {2,3,4};
    dot.setLocationCells(locations);

    int userGuess = 2;
    String result = dot.checkYourself(userGuess);
    System.out.println(result);
    String testResult = "failed";
    if (result.equals("hit") ) {
      testResult = "passed";
    }
    System.out.println(testResult);
  }
}