Example #1
0
  @Test
  public void testCanRollDie() throws RequiredMinDieFacesException {
    assertNotNull("Die did not roll", die.rollDie());

    /*
    try {
    	assertNotNull("Die did not roll", die.rollDie());
    } catch (RequiredMinDieFacesException rmdf) {
    	fail(rmdf.getLocalizedMessage());
    }
    */
  }
Example #2
0
  @Test
  public final void testDieRollLessThan1() {
    int testValue = -1;

    for (long i = 0; i < 100000000L; i++) {
      testValue = die.rollDie();

      if (testValue < 1) {
        System.out.println("INVALID Die value less than 1");
      }
    }
  }
Example #3
0
  @Test
  public final void testDieRollBetwen1And6() {
    int testValue = -1;

    for (long i = 0; i < 100000000L; i++) {
      testValue = die.rollDie();

      if (testValue < 1) {
        System.out.println("INVALID Die value less than 1");
      } else if (testValue > 6) {
        System.out.println("INVALID Die value more than 6");
      }
    }
  }
Example #4
0
 @Test
 public final void testDieRollNotNull() {
   assertNotNull(die.rollDie());
 }