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

              @Override
              public Criterion execute() {
                return givenASavedCriterionWithAnExistentType();
              }
            });
    assertFalse(criterionDAO.thereIsOtherWithSameNameAndType(c));
  }
Exemplo n.º 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));
  }
Exemplo n.º 3
0
 @Test
 @Transactional
 public void noOtherIfTheCriterionDoesntExist() {
   Criterion criterion = givenUniquelyNamedCriterion();
   assertFalse(criterionDAO.thereIsOtherWithSameNameAndType(criterion));
 }