office-alexander-logistics/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/TestPostionsnummernRegex.java

40 lines
1 KiB
Java

package com.alexanderlogistics;
import org.junit.Test;
import com.alexanderlogistics.datev.DatevCargosoftImportAdapter;
import junit.framework.Assert;
/**
* This test generates random test data
*
* @author rsoika
*
*/
public class TestPostionsnummernRegex {
/**
* Test positionnummern 'XX-YYY-####-###'
*/
@Test
public void testPutFileToFTP() {
Assert.assertTrue("AA-BBC-1234-991".matches(InvoicePlugin.REGEX_POSNUMER));
Assert.assertFalse("aa-BBC-1234-991".matches(InvoicePlugin.REGEX_POSNUMER));
Assert.assertFalse("CC-BBC-1234-991 ".matches(InvoicePlugin.REGEX_POSNUMER));
Assert.assertTrue("IM-ZEL-2101-005".matches(InvoicePlugin.REGEX_POSNUMER));
}
@Test
public void testCargoImportText() {
Assert.assertTrue("R3 EX-PRO-2208-054".matches(DatevCargosoftImportAdapter.REGEX_IMPORTTEXTPATTERN));
Assert.assertTrue("R3 VP".matches(DatevCargosoftImportAdapter.REGEX_IMPORTTEXTPATTERN));
Assert.assertFalse("R LA-HOL-2208-013".matches(DatevCargosoftImportAdapter.REGEX_IMPORTTEXTPATTERN));
}
}