PDA

View Full Version : Using Comparator<E> in a Test Driver


uniquity
03-02-2009, 10:59 PM
I was given an assignment to make an Ordered Linked List for one of my projects in class, but one of the requirements is to create the Test Driver first. The constructor of the Ordered Linked List takes an argument of Comparator<E> comparator and I wasn't exactly sure if I was using it correctly in the test driver so if someone could let me know if what I'm doing is fine or not, that'd be aweomse :thumbsup: Also, could someone give me some pointers on how to actually TEST a constructor? I don't really know what to do other than construct a new instance of the list. Thanks!


public void testConstructor()
{
OrderedLinkedList oll = new OrderedLinkedList( Comparator<Integer> comparator );
}

P.S. I'm using org.junit.Assert.* library for testing if you need to know