// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java
// public class TypeConverterException extends RuntimeException {
//     private static final long serialVersionUID = -7577535992947276304L;
//     public TypeConverterException(String message) {
//         super(message);
//     }
// }
// 
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookFieldSigningType.java
// public enum CopyBookFieldSigningType {
//     POSTFIX,
//     PREFIX,
//     LAST_BYTE_BIT8,
//     LAST_BYTE_EBCDIC_BIT5
// }


import com.nordea.oss.copybook.exceptions.TypeConverterException;
import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
/*
 * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk>
 * Copyright (c) 2016. Nordea Bank AB
 * Licensed under the MIT license (LICENSE.txt)
 */

package com.nordea.oss.copybook.converters;




public class SignedIntegerToBigIntegerPrefixTest {
    private TypeConverter typeConverter;
    private TypeConverterConfig config;

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

    @Before
    public void runBeforeEveryTest() {
        this.config = new TypeConverterConfig();
        this.config.setCharset(StandardCharsets.UTF_8);
        this.config.setPaddingChar('0');
        config.setSigningType(CopyBookFieldSigningType.PREFIX);
        typeConverter = new SignedIntegerToBigInteger();
        typeConverter.initialize(config);
    }

    @Test
    public void testValidateSuccess() throws Exception {
        typeConverter.validate(BigInteger.class, 2, -1);
    }

    @Test(expected = TypeConverterException.class)
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java
// public class TypeConverterException extends RuntimeException {
//     private static final long serialVersionUID = -7577535992947276304L;
//     public TypeConverterException(String message) {
//         super(message);
//     }
// }
// 
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookFieldSigningType.java
// public enum CopyBookFieldSigningType {
//     POSTFIX,
//     PREFIX,
//     LAST_BYTE_BIT8,
//     LAST_BYTE_EBCDIC_BIT5
// }


// Path: copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToBigIntegerPrefixTest.java
import com.nordea.oss.copybook.exceptions.TypeConverterException;
import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

/*
 * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk>
 * Copyright (c) 2016. Nordea Bank AB
 * Licensed under the MIT license (LICENSE.txt)
 */

package com.nordea.oss.copybook.converters;




public class SignedIntegerToBigIntegerPrefixTest {
    private TypeConverter typeConverter;
    private TypeConverterConfig config;

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

    @Before
    public void runBeforeEveryTest() {
        this.config = new TypeConverterConfig();
        this.config.setCharset(StandardCharsets.UTF_8);
        this.config.setPaddingChar('0');
        config.setSigningType(CopyBookFieldSigningType.PREFIX);
        typeConverter = new SignedIntegerToBigInteger();
        typeConverter.initialize(config);
    }

    @Test
    public void testValidateSuccess() throws Exception {
        typeConverter.validate(BigInteger.class, 2, -1);
    }

    @Test(expected = TypeConverterException.class)
    public void testValidateFail() throws Exception {