package com.alexanderlogistics;

import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.imixs.workflow.datev.imports.DatevImportAdapter;
import org.junit.Before;
import org.junit.Test;

import junit.framework.Assert;

/**
 * This test generates random test data
 * 
 * @author rsoika
 * 
 */
public class TestRunden {

    public static DateFormat dateFormat = new SimpleDateFormat("ddMMyyyy");
    public static DecimalFormat decimalFormat = new DecimalFormat("0.00");
    public static DecimalFormat rateFormat = new DecimalFormat("0.000000");

    private final static Logger logger = Logger.getLogger(TestFormat.class.getName());

    @Before
    public void setUp() throws Exception {

    }

    @Test
    public void testBetrag() {
        double d1 = 915.1400000000001;
        double d2 = 915.1400000000002;

        logger.info("d1="+d1);
        logger.info("d2="+d2);

        logger.info("d1="+InvoiceUtil.round(d1));
        logger.info("d2="+InvoiceUtil.round(d2));

         if (Math.abs(InvoiceUtil.round(d1)) > Math.abs(InvoiceUtil.round(d2))) {
             Assert.fail();
         }
        logger.info("Test erfolgreich");
    }
    
}
