@@ -0,0 +1,2806 @@
+package com.clutteredcode.ann.neuron;%0A%0Aimport com.clutteredcode.ann.activation.Activation;%0Aimport mockit.Expectations;%0Aimport mockit.Injectable;%0Aimport mockit.Mocked;%0Aimport mockit.Tested;%0Aimport org.junit.Test;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0Aimport static mockit.Deencapsulation.getField;%0Aimport static mockit.Deencapsulation.invoke;%0Aimport static mockit.Deencapsulation.setField;%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * @author cluttered.code@gmail.com%0A */%0Apublic class NeuronTest %7B%0A%0A    @Tested%0A    @Mocked%0A    @SuppressWarnings(%22unused%22)%0A    private Neuron neuron;%0A%0A    @Injectable%0A    @SuppressWarnings(%22unused%22)%0A    private Activation activation;%0A%0A    @Injectable%0A    private final double bias = Math.PI;%0A%0A    @Injectable%0A    @SuppressWarnings(%22unused%22)%0A    private List%3CDouble%3E inputWeights;%0A%0A    @Test%0A    public void testConstructor() %7B%0A        final Activation activationField = getField(neuron, %22activation%22);%0A        assertEquals(activation, activationField);%0A%0A        final double biasField = getField(neuron, %22bias%22);%0A        assertEquals(bias, biasField, 0.0);%0A%0A        final List%3CDouble%3E inputWeightsField = getField(neuron, %22inputWeights%22);%0A        assertEquals(inputWeights, inputWeightsField);%0A    %7D%0A%0A    @Test%0A    public void testFire_Single() %7B%0A        final List%3CDouble%3E inputs = Collections.singletonList(Math.E);%0A%0A        new Expectations() %7B%7B%0A            neuron.fire(inputs); times = 1; result = Math.PI;%0A        %7D%7D;%0A%0A        final double result = neuron.fire(Math.E);%0A%0A        assertEquals(Math.PI, result, 0.0);%0A    %7D%0A%0A    @Test%0A    public void testFire_List(@Mocked final List%3CDouble%3E inputs) %7B%0A        new Expectations() %7B%7B%0A            invoke(neuron, %22dotProductWithWeights%22, inputs); times = 1; result = Math.E;%0A            activation.evaluate(Math.E - bias); times = 1; result = Math.E;%0A        %7D%7D;%0A%0A        final double result = neuron.fire(inputs);%0A%0A        assertEquals(Math.E, result, 0.0);%0A    %7D%0A%0A    @Test%0A    public void testDotProductWithWeights() %7B%0A        final List%3CDouble%3E localWeights = Arrays.asList(83.4, 12.34, 34.68);%0A        final List%3CDouble%3E inputs = Arrays.asList(2.67, 29.55, 45.83);%0A        final double expected = 2176.7093999999997;%0A%0A        setField(neuron, %22inputWeights%22, localWeights);%0A%0A        final double result = invoke(neuron, %22dotProductWithWeights%22, inputs);%0A%0A        assertEquals(expected, result, 0.0);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testDotProductWithWeights_Exception() %7B%0A        final List%3CDouble%3E localWeights = Arrays.asList(83.4);%0A        final List%3CDouble%3E inputs = Arrays.asList(2.67, 29.55, 45.83);%0A%0A        setField(neuron, %22inputWeights%22, localWeights);%0A%0A        invoke(neuron, %22dotProductWithWeights%22, inputs);%0A    %7D%0A%7D

Add forgotten NeuronTest