<commit_before>package nl.dvberkel.kata.base64;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import static nl.dvberkel.kata.base64.Base64DecodeTestCase.verifyThat;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

@RunWith(Parameterized.class)
public class Base64DecodeTest {
    private final String source;
    private final byte[] destination;

    public Base64DecodeTest(Base64DecodeTestCase testCase) {
        this.source = testCase.getSource();
        this.destination = testCase.getDestination();
    }

    @Test
    public void shouldDecodeCorrectly() {
        assertThat((new Kata()).decode(source), is(destination));
    }

    @Parameterized.Parameters
    public static Collection<Base64DecodeTestCase[]> data() {
        List<Base64DecodeTestCase[]> data = new ArrayList<>();
        data.add(verifyThat("AAAA").decodesTo(0b0, 0b0, 0b0));
        return data;
    }
}

class Base64DecodeTestCase {
    private final String source;
    private byte[] destination;

    public static Base64DecodeTestCase verifyThat(String source) {
        return new Base64DecodeTestCase(source);
    }

    private Base64DecodeTestCase(String source) {
        this.source = source;
    }


    public Base64DecodeTestCase[] decodesTo(int... destination) {
        this.destination = new byte[destination.length];
        for (int index = 0; index < destination.length; index++) {
            this.destination[index] = (byte) destination[index];
        }

        return new Base64DecodeTestCase[] { this };<commit_msg>introduce a set up for Base64DecodeTest<commit_after>package nl.dvberkel.kata.base64;


import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import static nl.dvberkel.kata.base64.Base64DecodeTestCase.verifyThat;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

@RunWith(Parameterized.class)
public class Base64DecodeTest {
    private final String source;
    private final byte[] destination;
    private Kata kata;

    public Base64DecodeTest(Base64DecodeTestCase testCase) {
        this.source = testCase.getSource();
        this.destination = testCase.getDestination();
    }

    @Before
    public void createKata() throws Exception {
        kata = new Kata();
    }

    @Test
    public void shouldDecodeCorrectly() {
        assertThat(kata.decode(source), is(destination));
    }

    @Parameterized.Parameters
    public static Collection<Base64DecodeTestCase[]> data() {
        List<Base64DecodeTestCase[]> data = new ArrayList<>();
        data.add(verifyThat("AAAA").decodesTo(0b0, 0b0, 0b0));
        return data;
    }
}

class Base64DecodeTestCase {
    private final String source;
    private byte[] destination;

    public static Base64DecodeTestCase verifyThat(String source) {
        return new Base64DecodeTestCase(source);
    }

    private Base64DecodeTestCase(String source) {
        this.source = source;
    }


    public Base64DecodeTestCase[] decodesTo(int... destination) {
        this.destination = new byte[destination.length];
        for (int index = 0; index < destination.length; index++) {
            this.destination[index] = (byte) destination[index];
        }

        return new Base64DecodeTestCase[]{this};
{'fraction_non_alphanumeric': 0.10176619007569386, 'fraction_numerical': 0.020185029436501262, 'mean_word_length': 3.5861182519280206, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6125392', 'n_tokens_mistral': 1046, 'n_tokens_neox': 996, 'n_words': 229}