// Path: src/main/java/com/maxmind/minfraud/request/Order.java
// public static final class Builder {
//     private static final Pattern CURRENCY_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
// 
//     BigDecimal amount;
//     String currency;
//     String discountCode;
//     String affiliateId;
//     String subaffiliateId;
//     URI referrerUri;
//     private Boolean isGift;
//     private Boolean hasGiftMessage;
// 
//     /**
//      * @param amount The total order amount for the transaction.
//      * @return The builder object.
//      */
//     public Order.Builder amount(BigDecimal amount) {
//         this.amount = amount;
//         return this;
//     }
// 
//     /**
//      * @param amount The total order amount for the transaction.
//      * @return The builder object.
//      */
//     public Order.Builder amount(Double amount) {
//         this.amount = BigDecimal.valueOf(amount);
//         return this;
//     }
// 
//     /**
//      * @param code The ISO 4217 currency code for the currency used in the
//      *             transaction.
//      * @return The builder object.
//      * @throws IllegalArgumentException when currency is not a valid
//      *                                  three-letter currency code.
//      */
//     public Order.Builder currency(String code) {
//         if (!CURRENCY_CODE_PATTERN.matcher(code).matches()) {
//             throw new IllegalArgumentException("The currency code " + code + " is invalid.");
//         }
//         currency = code;
//         return this;
//     }
// 
//     /**
//      * @param code The discount code applied to the transaction. If
//      *             multiple discount codes were used, please
//      *             separate them with a comma.
//      * @return The builder object.
//      */
//     public Order.Builder discountCode(String code) {
//         discountCode = code;
//         return this;
//     }
// 
//     /**
//      * @param id The ID of the affiliate where the order is coming from.
//      * @return The builder object.
//      */
//     public Order.Builder affiliateId(String id) {
//         affiliateId = id;
//         return this;
//     }
// 
//     /**
//      * @param isGift Whether order was marked as a gift by the purchaser.
//      * @return The builder object.
//      */
//     public Order.Builder isGift(boolean isGift) {
//         this.isGift = isGift;
//         return this;
//     }
// 
//     /**
//      * @param hasGiftMessage Whether the purchaser included a gift message.
//      * @return The builder object.
//      */
//     public Order.Builder hasGiftMessage(boolean hasGiftMessage) {
//         this.hasGiftMessage = hasGiftMessage;
//         return this;
//     }
// 
//     /**
//      * @param id The ID of the sub-affiliate where the order is coming
//      *           from.
//      * @return The builder object.
//      */
//     public Order.Builder subaffiliateId(String id) {
//         subaffiliateId = id;
//         return this;
//     }
// 
//     /**
//      * @param uri The URI of the referring site for this order.
//      * @return The builder object.
//      */
//     public Order.Builder referrerUri(URI uri) {
//         referrerUri = uri;
//         return this;
//     }
// 
//     /**
//      * @return An instance of {@code Order} created from the
//      * fields set on this builder.
//      */
//     public Order build() {
//         return new Order(this);
//     }
// }


import com.maxmind.minfraud.request.Order.Builder;
import org.junit.Test;
import java.math.BigDecimal;
import java.net.URI;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
    @Test(expected = IllegalArgumentException.class)
    public void testCurrencyThatIsTooShort() {
        new Builder().currency("US").build();
    }


    @Test(expected = IllegalArgumentException.class)
    public void testCurrencyThatIsTooLong() {
        new Builder().currency("USDE").build();
    }

    @Test(expected = IllegalArgumentException.class)
    public void testCurrencyInWrongCase() {
        new Builder().currency("usd").build();
    }

    @Test
    public void testDiscountCode() {
        Order order = new Builder().discountCode("dsc").build();
        assertEquals("dsc", order.getDiscountCode());
    }

    @Test
    public void testAffiliateId() {
        Order order = new Builder().affiliateId("af").build();
        assertEquals("af", order.getAffiliateId());
    }

    @Test
    public void testSubaffiliateId() {
// Path: src/main/java/com/maxmind/minfraud/request/Order.java
// public static final class Builder {
//     private static final Pattern CURRENCY_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
// 
//     BigDecimal amount;
//     String currency;
//     String discountCode;
//     String affiliateId;
//     String subaffiliateId;
//     URI referrerUri;
//     private Boolean isGift;
//     private Boolean hasGiftMessage;
// 
//     /**
//      * @param amount The total order amount for the transaction.
//      * @return The builder object.
//      */
//     public Order.Builder amount(BigDecimal amount) {
//         this.amount = amount;
//         return this;
//     }
// 
//     /**
//      * @param amount The total order amount for the transaction.
//      * @return The builder object.
//      */
//     public Order.Builder amount(Double amount) {
//         this.amount = BigDecimal.valueOf(amount);
//         return this;
//     }
// 
//     /**
//      * @param code The ISO 4217 currency code for the currency used in the
//      *             transaction.
//      * @return The builder object.
//      * @throws IllegalArgumentException when currency is not a valid
//      *                                  three-letter currency code.
//      */
//     public Order.Builder currency(String code) {
//         if (!CURRENCY_CODE_PATTERN.matcher(code).matches()) {
//             throw new IllegalArgumentException("The currency code " + code + " is invalid.");
//         }
//         currency = code;
//         return this;
//     }
// 
//     /**
//      * @param code The discount code applied to the transaction. If
//      *             multiple discount codes were used, please
//      *             separate them with a comma.
//      * @return The builder object.
//      */
//     public Order.Builder discountCode(String code) {
//         discountCode = code;
//         return this;
//     }
// 
//     /**
//      * @param id The ID of the affiliate where the order is coming from.
//      * @return The builder object.
//      */
//     public Order.Builder affiliateId(String id) {
//         affiliateId = id;
//         return this;
//     }
// 
//     /**
//      * @param isGift Whether order was marked as a gift by the purchaser.
//      * @return The builder object.
//      */
//     public Order.Builder isGift(boolean isGift) {
//         this.isGift = isGift;
//         return this;
//     }
// 
//     /**
//      * @param hasGiftMessage Whether the purchaser included a gift message.
//      * @return The builder object.
//      */
//     public Order.Builder hasGiftMessage(boolean hasGiftMessage) {
//         this.hasGiftMessage = hasGiftMessage;
//         return this;
//     }
// 
//     /**
//      * @param id The ID of the sub-affiliate where the order is coming
//      *           from.
//      * @return The builder object.
//      */
//     public Order.Builder subaffiliateId(String id) {
//         subaffiliateId = id;
//         return this;
//     }
// 
//     /**
//      * @param uri The URI of the referring site for this order.
//      * @return The builder object.
//      */
//     public Order.Builder referrerUri(URI uri) {
//         referrerUri = uri;
//         return this;
//     }
// 
//     /**
//      * @return An instance of {@code Order} created from the
//      * fields set on this builder.
//      */
//     public Order build() {
//         return new Order(this);
//     }
// }


// Path: src/test/java/com/maxmind/minfraud/request/OrderTest.java
import com.maxmind.minfraud.request.Order.Builder;
import org.junit.Test;
import java.math.BigDecimal;
import java.net.URI;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

    @Test(expected = IllegalArgumentException.class)
    public void testCurrencyThatIsTooShort() {
        new Builder().currency("US").build();
    }


    @Test(expected = IllegalArgumentException.class)
    public void testCurrencyThatIsTooLong() {
        new Builder().currency("USDE").build();
    }

    @Test(expected = IllegalArgumentException.class)
    public void testCurrencyInWrongCase() {
        new Builder().currency("usd").build();
    }

    @Test
    public void testDiscountCode() {
        Order order = new Builder().discountCode("dsc").build();
        assertEquals("dsc", order.getDiscountCode());
    }

    @Test
    public void testAffiliateId() {
        Order order = new Builder().affiliateId("af").build();
        assertEquals("af", order.getAffiliateId());
    }

    @Test
    public void testSubaffiliateId() {
        Order order = new Builder().subaffiliateId("saf").build();