// 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;
package org.blackdread.filtersortjooqapi.filter.parser;


class FilterParserByteTest {

    @Test
    void parse() {
        Assertions.assertEquals(10, (byte) FilterParser.ofByte().parse("10"));
        Assertions.assertEquals(0x0F, (byte) FilterParser.ofByte().parse("15"));
        Assertions.assertEquals(127, (byte) FilterParser.ofByte().parse("127"));
        Assertions.assertEquals(0, (byte) FilterParser.ofByte().parse("0"));
        Assertions.assertEquals(1, (byte) FilterParser.ofByte().parse("1"));
    }

    @Test
    void parseThrows() {
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("0xFF"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("0xF"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("AFA"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("Odwdw0"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("OxFFFF"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse(" 5   "));
    }

    @Test
    void parseWithApiException() {
        Assertions.assertEquals(5, (byte) FilterParser.ofByte().parseWithApiException("5"));
        Assertions.assertEquals(-5, (byte) FilterParser.ofByte().parseWithApiException("-5"));
        Assertions.assertEquals(0, (byte) FilterParser.ofByte().parseWithApiException("0"));
        Assertions.assertEquals(66, (byte) FilterParser.ofByte().parseWithApiException("066"));
        Assertions.assertEquals(1, (byte) FilterParser.ofByte().parseWithApiException("000001"));
    }

    @Test
    void parseWithApiExceptionThrows() {
// 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/FilterParserByteTest.java
import org.blackdread.filtersortjooqapi.exception.FilteringApiException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

package org.blackdread.filtersortjooqapi.filter.parser;


class FilterParserByteTest {

    @Test
    void parse() {
        Assertions.assertEquals(10, (byte) FilterParser.ofByte().parse("10"));
        Assertions.assertEquals(0x0F, (byte) FilterParser.ofByte().parse("15"));
        Assertions.assertEquals(127, (byte) FilterParser.ofByte().parse("127"));
        Assertions.assertEquals(0, (byte) FilterParser.ofByte().parse("0"));
        Assertions.assertEquals(1, (byte) FilterParser.ofByte().parse("1"));
    }

    @Test
    void parseThrows() {
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("0xFF"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("0xF"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("AFA"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("Odwdw0"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse("OxFFFF"));
        Assertions.assertThrows(NumberFormatException.class, () -> FilterParser.ofByte().parse(" 5   "));
    }

    @Test
    void parseWithApiException() {
        Assertions.assertEquals(5, (byte) FilterParser.ofByte().parseWithApiException("5"));
        Assertions.assertEquals(-5, (byte) FilterParser.ofByte().parseWithApiException("-5"));
        Assertions.assertEquals(0, (byte) FilterParser.ofByte().parseWithApiException("0"));
        Assertions.assertEquals(66, (byte) FilterParser.ofByte().parseWithApiException("066"));
        Assertions.assertEquals(1, (byte) FilterParser.ofByte().parseWithApiException("000001"));
    }

    @Test
    void parseWithApiExceptionThrows() {
        Assertions.assertThrows(FilteringApiException.class, () -> FilterParser.ofByte().parseWithApiException("AFA"));