Beispiel #1
0
  @Test
  public void thereIsNoOtherIfItsTheSame() {
    Criterion c =
        transactionService.runOnTransaction(
            new IOnTransaction<Criterion>() {

              @Override
              public Criterion execute() {
                return givenASavedCriterionWithAnExistentType();
              }
            });
    assertFalse(criterionDAO.thereIsOtherWithSameNameAndType(c));
  }
Beispiel #2
0
  @Test
  public void ifItsDifferentThereIsOther() {
    Criterion c =
        transactionService.runOnTransaction(
            new IOnTransaction<Criterion>() {

              @Override
              public Criterion execute() {
                return givenASavedCriterionWithAnExistentType();
              }
            });
    Criterion copy = Criterion.create(c.getName(), c.getType());
    assertTrue(criterionDAO.thereIsOtherWithSameNameAndType(copy));
  }
Beispiel #3
0
 @Test
 @Transactional
 public void noOtherIfTheCriterionDoesntExist() {
   Criterion criterion = givenUniquelyNamedCriterion();
   assertFalse(criterionDAO.thereIsOtherWithSameNameAndType(criterion));
 }