Sha256: bc739666453ee86e2c8562c806761b8cdf838749b6a1c95f9745db646ff2bc70
Contents?: true
Size: 1.52 KB
Versions: 70
Compression:
Stored size: 1.52 KB
Contents
import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; public class DoublyLinkedListTest { private DoublyLinkedList<Integer> subject; @Before public void setUp() { subject = new DoublyLinkedList<>(); } @Test public void testPushPop() { subject.push(10); subject.push(20); assertThat(subject.pop(), is(20)); assertThat(subject.pop(), is(10)); } @Ignore @Test public void testPushShift() { subject.push(10); subject.push(20); assertThat(subject.shift(), is(10)); assertThat(subject.shift(), is(20)); } @Ignore @Test public void testUnshiftShift() { subject.unshift(10); subject.unshift(20); assertThat(subject.shift(), is(20)); assertThat(subject.shift(), is(10)); } @Ignore @Test public void testUnshiftPop() { subject.unshift(10); subject.unshift(20); assertThat(subject.pop(), is(10)); assertThat(subject.pop(), is(20)); } @Ignore @Test public void testExample() { subject.push(10); subject.push(20); assertThat(subject.pop(), is(20)); subject.push(30); assertThat(subject.shift(), is(10)); subject.unshift(40); subject.push(50); assertThat(subject.shift(), is(40)); assertThat(subject.pop(), is(50)); assertThat(subject.shift(), is(30)); } }
Version data entries
70 entries across 70 versions & 1 rubygems