<commit_before>package nl.jft.common.util.elo;

import nl.jft.common.util.util.CommonTestUtil;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

/**
 * @author <NAME>
 */
public class EloExpectationResultTest {

    @Rule
    public ExpectedException expectedException = ExpectedException.none();

    @Test
    public void constructor_withNullArgument_expectsNullPointerException() throws Exception {
        expectedException.expect(NullPointerException.class);

        EloExpectationResult result = new EloExpectationResult(null, 0, 0, 0, 0);
    }

    @Test
    public void getNewRating1_withDefault_returnsDouble() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //newRating1 = 3010

        double expected = 3010d;
        double actual = result.getNewFirstRating();
    }

    @Test
    public void getNewRating2_withDefault_returnsDouble() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //newRating2 = 2498

        double expected = 2498d;
        double actual = result.getNewSecondRating();
    }

    @Test
    public void getError1_withDefault_returnsDouble() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //error1 = 0

        double expected = 0d;
        double actual = result.getFirstError();
    }

    @Test
    public void getError2_withDefault_returnsDouble() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //error2 = 0

        double expected = 0d;
        double actual = result.getSecondError();
    }

    //TODO make a test for the EloExpectation property.
}<commit_msg>Added test to EloExpectationResultTest<commit_after>package nl.jft.common.util.elo;

import nl.jft.common.util.util.CommonTestUtil;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

/**
 * @author <NAME>
 */
public class EloExpectationResultTest {

    @Rule
    public ExpectedException expectedException = ExpectedException.none();

    @Test
    public void constructor_withNullArgument_expectsNullPointerException() throws Exception {
        expectedException.expect(NullPointerException.class);

        EloExpectationResult result = new EloExpectationResult(null, 0, 0, 0, 0);
    }

    @Test
    public void getNewRating1_withDefault_returnsDouble() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //newRating1 = 3010

        double expected = 3010d;
        double actual = result.getNewFirstRating();

        Assert.assertEquals(expected, actual, 0.01d);
    }

    @Test
    public void getNewRating2_withDefault_returnsDouble() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //newRating2 = 2498

        double expected = 2498d;
        double actual = result.getNewSecondRating();

        Assert.assertEquals(expected, actual, 0.01d);
    }

    @Test
    public void getError1_withDefault_returnsDouble() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //error1 = 0

        double expected = 0d;
        double actual = result.getFirstError();

        Assert.assertEquals(expected, actual, 0.01d);
    }

    @Test
    public void getError2_withDefault_returnsDouble() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //error2 = 0

        double expected = 0d;
        double actual = result.getSecondError();

        Assert.assertEquals(expected, actual, 0.01d);
    }

    @Test
    public void getEloExpectation_withDefault_returnsEloExpectation() throws Exception {
        EloExpectationResult result = CommonTestUtil.getDefaultExpectationResult(); //eloExpectation = defaultEloExpectation

        EloExpectation expected = CommonTestUtil.getDefaultExpectation();
        EloExpectation actual = result.getExpectation();

        Assert.assertEquals(expected, actual);
    }
}
{'fraction_non_alphanumeric': 0.08188824662813102, 'fraction_numerical': 0.018304431599229287, 'mean_word_length': 3.655829596412556, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7321638', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1096, 'n_words': 250}