Assert.assertEquals(islonger.getValue(), testedislonger.getValue());
}
@Test
public void testCut() throws BlockError {
IsNotLongerConstraint islonger = new IsNotLongerConstraint();
islonger.setValue(4);
// Prepare record
RecordImpl r = new RecordImpl();
r.add(new Field("a", "aaaaaa"));
r.add(new Field("b", "bbbbb"));
r.add(new Field("c", "cccc"));
r.add(new Field("d", "ddd"));
List<String> applyTo = new ArrayList<String>(3);
applyTo.add("a");
islonger.setApplyTo(applyTo);
Assert.assertFalse(islonger.check(r, new VariableSpace()).isPassed());
applyTo = new ArrayList<String>(3);
applyTo.add("b");
islonger.setApplyTo(applyTo);
Assert.assertFalse(islonger.check(r, new VariableSpace()).isPassed());
applyTo = new ArrayList<String>(3);
applyTo.add("c");
islonger.setApplyTo(applyTo);
Assert.assertTrue(islonger.check(r, new VariableSpace()).isPassed());
applyTo = new ArrayList<String>(3);
applyTo.add("d");
islonger.setApplyTo(applyTo);
Assert.assertTrue(islonger.check(r, new VariableSpace()).isPassed());
applyTo = new ArrayList<String>(3);
applyTo.add("d");
applyTo.add("a");
islonger.setApplyTo(applyTo);
Assert.assertFalse(islonger.check(r, new VariableSpace()).isPassed());
}