finished unit test for Banking

This commit is contained in:
Sven Vogel 2023-07-03 19:00:25 +02:00
parent 8a42fdc38d
commit 882532fb6a
1 changed files with 7 additions and 1 deletions

View File

@ -3,18 +3,24 @@ package me.teridax.jcash.banking;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
public class BankTest {
@Test
public void testBlzValidation() {
// everything is fine
assertEquals(Bank.validateBlz("MA2424"), "MA2424");
assertEquals(Bank.validateBlz("VR-BANK-567"), "VR-BANK-567");
assertEquals(Bank.validateBlz("19087"), "19087");
// cut stuff away
assertEquals(Bank.validateBlz("MA2%asd424"), "MA2");
assertEquals(Bank.validateBlz("qg0948 z67 0"), "qg0948");
}
@Test(expected = IllegalArgumentException.class)
public void testBlzValidationException() {
assertEquals(Bank.validateBlz("MA2.&424"), "MA2.&424");
assertNotEquals(Bank.validateBlz("öüäöüäöü"), "öüäöüäöü");
}
}