package nl.dvberkel.kata;

import org.junit.Test;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class VLQEncodeTest {
    @Test
    public void shouldEncodeCorrectly() {
        assertThat(new Kata().encode(0), is(new byte[]{0b0}));
    }
}

@@ -43,16 +43,260 @@
 t.Test;%0A
+import org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0A%0Aimport java.math.BigInteger;%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Aimport static nl.dvberkel.kata.VLQEncodeTestCase.verifyThat;
 %0Aimport 
@@ -372,16 +372,46 @@
 tThat;%0A%0A
+@RunWith(Parameterized.class)%0A
 public c
@@ -439,123 +439,1447 @@
     
-@Test%0A    public void shouldEncodeCorrectly() %7B%0A        assertThat(new Kata().encode(0), is(new byte%5B%5D%7B0b0%7D));%0A    %7D%0A%7D%0A
+private final BigInteger source;%0A    private final byte%5B%5D destination;%0A%0A    public VLQEncodeTest(VLQEncodeTestCase testCase) %7B%0A        this.source = testCase.getSource();%0A        this.destination = testCase.getDestination();%0A    %7D%0A%0A    @Test%0A    public void shouldEncodeCorrectly() %7B%0A        assertThat(new Kata().encode(source), is(destination));%0A    %7D%0A%0A    @Parameterized.Parameters%0A    public static Collection%3CObject%5B%5D%3E data() %7B%0A        List%3CObject%5B%5D%3E testCases = new ArrayList%3CObject%5B%5D%3E();%0A        testCases.add(verifyThat(0).encodesAs(0b0));%0A        return testCases;%0A    %7D%0A%7D%0A%0Aclass VLQEncodeTestCase %7B%0A    private final BigInteger source;%0A    private byte%5B%5D destination;%0A%0A    public static VLQEncodeTestCase verifyThat(int source) %7B%0A        return verifyThat(BigInteger.valueOf(source));%0A    %7D%0A%0A%0A    public static VLQEncodeTestCase verifyThat(BigInteger source) %7B%0A        return new VLQEncodeTestCase(source);%0A    %7D%0A%0A    private VLQEncodeTestCase(BigInteger source) %7B%0A        this.source = source;%0A    %7D%0A%0A    public Object%5B%5D encodesAs(int... destination) %7B%0A        this.destination = new byte%5Bdestination.length%5D;%0A        for (int index = 0; index %3C destination.length; index++) %7B%0A            this.destination%5Bindex%5D = (byte) destination%5Bindex%5D;%0A        %7D%0A        return new Object%5B%5D%7Bthis%7D;%0A    %7D%0A%0A    public BigInteger getSource() %7B%0A        return source;%0A    %7D%0A%0A    public byte%5B%5D getDestination() %7B%0A        return destination;%0A    %7D%0A%7D

create a parameterized test runner