/*
   * Test method for {@link de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.RegularIFNetTransition#removeGuard(de.invation.code.toval.constraint.AbstractConstraint)}.
   */
  @Test
  public void testRemoveGuard() throws ParameterException {
    IFNet sNet = IFNetTestUtil.createSimpleIFNet();
    RegularIFNetTransition trans = (RegularIFNetTransition) sNet.getTransition("tIn");

    // Get the gurads and check there are no guards initially
    Set<AbstractConstraint<?>> guards = trans.getGuards();
    assertTrue(guards.isEmpty());

    // add a guard and make sure it is really there
    trans.setGuardDataContainer(new TestGuardDataContainer(sNet.getTokenColors()));
    NumberConstraint nc = new NumberConstraint("green", NumberOperator.LARGER, -3);
    trans.addGuard(nc);
    assertFalse(guards.isEmpty());

    // remove it again
    trans.removeGuard(nc);
    assertTrue(guards.isEmpty());
  }