// Path: src/main/java/org/blackdread/filtersortjooqapi/exception/FilteringApiException.java
// public class FilteringApiException extends BadUsageApiException {
// 
//     public FilteringApiException(final String message) {
//         super(message);
//     }
// }


import org.blackdread.filtersortjooqapi.exception.FilteringApiException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.stream.Stream;
package org.blackdread.filtersortjooqapi.filter.parser;



class FilterParserIntTest {

    static Stream<String> badStringValuesToParse() {
        return Stream.of("foo", "poiuytd", "Odwdw0", "O", "  5", "   6", "--4");
    }

    static Stream<Arguments> goodStringParsableAndResult() {
        return Stream.of(Arguments.of("5", 5), Arguments.of("-5", -5), Arguments.of("0", 0),
            Arguments.of("006", 6), Arguments.of("3132324", 3132324));
    }

    @ParameterizedTest
    @MethodSource("goodStringParsableAndResult")
    void parse(final String argument, final int expected) {
        Assertions.assertEquals(expected, (int) FilterParser.ofInt().parse(argument));
    }

    @ParameterizedTest
    @MethodSource("badStringValuesToParse")
    void parseThrows(final String argument) {
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofInt().parse(argument));
    }

    @ParameterizedTest
    @MethodSource("goodStringParsableAndResult")
    void parseWithApiException(final String argument, final int expected) {
        Assertions.assertEquals(expected, (int) FilterParser.ofInt().parseWithApiException(argument));
    }

    @ParameterizedTest
    @MethodSource("badStringValuesToParse")
    void parseWithApiExceptionThrows(final String argument) {
// Path: src/main/java/org/blackdread/filtersortjooqapi/exception/FilteringApiException.java
// public class FilteringApiException extends BadUsageApiException {
// 
//     public FilteringApiException(final String message) {
//         super(message);
//     }
// }


// Path: src/test/java/org/blackdread/filtersortjooqapi/filter/parser/FilterParserIntTest.java
import org.blackdread.filtersortjooqapi.exception.FilteringApiException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.stream.Stream;

package org.blackdread.filtersortjooqapi.filter.parser;



class FilterParserIntTest {

    static Stream<String> badStringValuesToParse() {
        return Stream.of("foo", "poiuytd", "Odwdw0", "O", "  5", "   6", "--4");
    }

    static Stream<Arguments> goodStringParsableAndResult() {
        return Stream.of(Arguments.of("5", 5), Arguments.of("-5", -5), Arguments.of("0", 0),
            Arguments.of("006", 6), Arguments.of("3132324", 3132324));
    }

    @ParameterizedTest
    @MethodSource("goodStringParsableAndResult")
    void parse(final String argument, final int expected) {
        Assertions.assertEquals(expected, (int) FilterParser.ofInt().parse(argument));
    }

    @ParameterizedTest
    @MethodSource("badStringValuesToParse")
    void parseThrows(final String argument) {
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofInt().parse(argument));
    }

    @ParameterizedTest
    @MethodSource("goodStringParsableAndResult")
    void parseWithApiException(final String argument, final int expected) {
        Assertions.assertEquals(expected, (int) FilterParser.ofInt().parseWithApiException(argument));
    }

    @ParameterizedTest
    @MethodSource("badStringValuesToParse")
    void parseWithApiExceptionThrows(final String argument) {
        Assertions.assertThrows(FilteringApiException.class, () -> FilterParser.ofInt().parseWithApiException(argument));