示例#1
0
  @Test
  public void shouldRecordAcceptance() {
    // Given
    License license = new License("...", "...");

    // When
    license.accept();

    // Then
    assertTrue(license.isAccepted());
  }
示例#2
0
  @Test
  public void shouldRecordRejection() {
    // Given
    License license = new License("...", "...");
    license.accept();

    // When
    try {
      license.reject();
    } catch (LicenseRejectedException ignored) {
    }

    // Then: last action should win
    assertFalse(license.isAccepted());
  }