<commit_before>/**
 * Copyright 2014-2016 the original author or authors
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.wandrell.tabletop.dice.test.integration.parser;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.wandrell.tabletop.dice.notation.operand.IntegerOperand;
import com.wandrell.tabletop.dice.parser.DefaultDiceNotationParser;
import com.wandrell.tabletop.dice.parser.DiceNotationParser;
import com.wandrell.tabletop.dice.roller.DefaultRoller;

/**
 * Integration tests for {@code DefaultDiceNotationParser}, checking that it
 * parses numbers.
 * 
 * @author <NAME>
 */
public final class ITDefaultDiceNotationParserNumber {

    /**
     * Default constructor.
     */
    public ITDefaultDiceNotationParserNumber() {
        super();
    }

    /**
     * Tests that positive numbers can be parsed.
     */
    @Test
    public final void testParse_Positive() {
        final IntegerOperand value;
        final String notation;
        final DiceNotationParser parser;

        parser = new DefaultDiceNotationParser(new DefaultRoller());

        notation = "12";

        value = (IntegerOperand) parser.parse(notation);

        Assert.assertEquals(value.getValue(), (Integer) 12);

        Assert.assertEquals(value.getExpression(), notation);
    }

    /**
     * Tests that the zero value can be parsed.
     */
    @Test
    public final void testParse_Zero() {
        final IntegerOperand value;
        final String notation;
        final DiceNotationParser parser;

        parser = new DefaultDiceNotationParser(new DefaultRoller());

        notation = "0";

        value = (IntegerOperand) parser.parse(notation);

        Assert.assertEquals(value.getValue(), (Integer) 0);

        Assert.assertEquals(value.getExpression(), notation);
    }

}
<commit_msg>Simplified tests<commit_after>/**
 * Copyright 2014-2016 the original author or authors
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.wandrell.tabletop.dice.test.integration.parser;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.wandrell.tabletop.dice.notation.operand.IntegerOperand;
import com.wandrell.tabletop.dice.parser.DefaultDiceNotationParser;
import com.wandrell.tabletop.dice.parser.DiceNotationParser;
import com.wandrell.tabletop.dice.roller.DefaultRoller;

/**
 * Integration tests for {@code DefaultDiceNotationParser}, checking that it
 * parses numbers.
 * 
 * @author <NAME>
 */
public final class ITDefaultDiceNotationParserNumber {

    /**
     * Default constructor.
     */
    public ITDefaultDiceNotationParserNumber() {
        super();
    }

    /**
     * Tests that parsing a positive number gives that number as value.
     */
    @Test
    public final void testParse_Positive_Value() {
        final IntegerOperand value;
        final DiceNotationParser parser;

        parser = new DefaultDiceNotationParser(new DefaultRoller());

        value = (IntegerOperand) parser.parse("12");

        Assert.assertEquals(value.getValue(), (Integer) 12);
    }

    /**
     * Tests that parsing zero gives that number as value.
     */
    @Test
    public final void testParse_Zero() {
        final IntegerOperand value;
        final DiceNotationParser parser;

        parser = new DefaultDiceNotationParser(new DefaultRoller());

        value = (IntegerOperand) parser.parse("0");

        Assert.assertEquals(value.getValue(), (Integer) 0);
    }

}

{'fraction_non_alphanumeric': 0.09454061251664447, 'fraction_numerical': 0.007989347536617843, 'mean_word_length': 3.3129186602870813, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2775782', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1220, 'n_words': 382}