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

Version Path
trackler-2.1.0.8 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.1.0.7 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.1.0.6 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.1.0.5 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.1.0.4 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.1.0.3 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.1.0.2 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.1.0.1 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.1.0.0 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.55 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.54 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.53 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.52 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.51 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.50 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.49 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.48 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.47 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.46 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java
trackler-2.0.8.45 tracks/java/exercises/linked-list/src/test/java/DoublyLinkedListTest.java