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)); } }