Commit 4f54e8fa authored by yazan.halloul's avatar yazan.halloul

test LineSequenceComparator and LineSequence Classes

parent e3949f82
import benefit_classes.LineSequence;
import benefit_classes.LineSequenceComparator;
import junit.framework.Assert;
import junit.framework.TestCase;
public class LineSequenceComparatorTest extends TestCase {
public LineSequence lineSequence1;
public LineSequence lineSequence2;
public LineSequenceComparator lineSequenceComparator;
public void testIsGreaterThan(){
lineSequenceComparator = new LineSequenceComparator();
lineSequence1 = new LineSequence("test",1);
lineSequence2 = new LineSequence("test",2);
assertEquals(lineSequenceComparator.compare(lineSequence1,lineSequence2),-1);
}
public void testIsLessThan(){
lineSequenceComparator = new LineSequenceComparator();
lineSequence1 = new LineSequence("test",2);
lineSequence2 = new LineSequence("test",1);
assertEquals(lineSequenceComparator.compare(lineSequence1,lineSequence2),1);
}
public void testIsEqual(){
lineSequenceComparator = new LineSequenceComparator();
lineSequence1 = new LineSequence("test",1);
lineSequence2 = new LineSequence("test",1);
assertEquals(lineSequenceComparator.compare(lineSequence1,lineSequence2),0);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment