テストプログラム

TDUList2Test


package tdu;
import static org.junit.Assert.*;
import org.junit.Test;
public class TDUList2Test {
	@Test
	public void testSize() {
		TDUList2 list = new TDUList2();
		Node<String> n0 = new Node<String>();
		Node<String> n3 = new Node<String>("abc");
		Node<String> n2 = new Node<String>(null);
		Node<String> n1 = new Node<String>("efg");
		n1.next=n0;
		n2.next=n1;
		n3.next=n2;
		list.node=n0;
		assertEquals(0,list.size());
		list.node=n1;
		assertEquals(1,list.size());
		list.node=n2;
		assertEquals(2,list.size());
		list.node=n3;
		assertEquals(3,list.size());
	}

}