Demo entry 6320333

d

   

Submitted by anonymous on Nov 09, 2016 at 14:20
Language: Java. Code size: 401 Bytes.

public class CounterTest {
    private Counter counter;

    @Before
    public void setUp() {
        counter = new Counter(5);
    }

    @Test
    public void incrementingOne() {
        counter.increment(1);
        assertEquals(counter.get(), 6);
    }

    @Test
    public void incrementingTwo() {
        counter.increment(2);
        assertEquals(counter.get(), 7);
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).