<commit_before>package com.cluttered.cryptocurrency.ann;

import com.cluttered.cryptocurrency.ann.neuron.Neuron;
import mockit.Expectations;
import mockit.Injectable;
import mockit.Mocked;
import mockit.Tested;
import mockit.integration.junit4.JMockit;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

import static mockit.Deencapsulation.setField;
import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author <EMAIL>
 */
@RunWith(JMockit.class)
public class LayerTest {

    @Tested
    @SuppressWarnings("unused")
    private Layer layer;

    @Injectable
    @SuppressWarnings("unused")
    private List<Neuron> neurons;

    @Test
    public void testFire(@Mocked final List<BigDecimal> inputs,
                         @Mocked final Neuron neuron,
                         @Mocked final BigDecimal expected1,
                         @Mocked final BigDecimal expected2,
                         @Mocked final BigDecimal expected3) {
        final List<Neuron> neurons = Arrays.asList(neuron, neuron, neuron);
        setField(layer, "neurons", neurons);

        new Expectations() {{
            neuron.fire(inputs); times = 3; returns(expected1, expected2, expected3);
        }};

        final List<BigDecimal> result = layer.fire(inputs);

        assertThat(result).containsExactly(
                expected1,
                expected2,
                expected3
        );
    }
}<commit_msg>use concrete BigDeciamals in layerTest instead of mocked<commit_after>package com.cluttered.cryptocurrency.ann;

import com.cluttered.cryptocurrency.ann.neuron.Neuron;
import mockit.Expectations;
import mockit.Injectable;
import mockit.Mocked;
import mockit.Tested;
import mockit.integration.junit4.JMockit;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

import static mockit.Deencapsulation.setField;
import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author <EMAIL>
 */
@RunWith(JMockit.class)
public class LayerTest {

    @Tested
    @SuppressWarnings("unused")
    private Layer layer;

    @Injectable
    @SuppressWarnings("unused")
    private List<Neuron> neurons;

    @Test
    public void testFire(@Mocked final List<BigDecimal> inputs,
                         @Mocked final Neuron neuron) {

        final BigDecimal expected1 = BigDecimal.valueOf(1);
        final BigDecimal expected2 = BigDecimal.valueOf(2);
        final BigDecimal expected3 = BigDecimal.valueOf(3);

        final List<Neuron> neurons = Arrays.asList(neuron, neuron, neuron);
        setField(layer, "neurons", neurons);

        new Expectations() {{
            neuron.fire(inputs); times = 3; returns(expected1, expected2, expected3);
        }};

        final List<BigDecimal> result = layer.fire(inputs);

        assertThat(result).containsExactly(
                expected1,
                expected2,
                expected3
        );
    }
}
{'fraction_non_alphanumeric': 0.09875328083989501, 'fraction_numerical': 0.008202099737532808, 'mean_word_length': 2.884076433121019, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4822421', 'n_tokens_mistral': 926, 'n_tokens_neox': 881, 'n_words': 195}