From 882532fb6a9f75c3fbf5b4dbb2abdebbaa89c8d4 Mon Sep 17 00:00:00 2001 From: teridax Date: Mon, 3 Jul 2023 19:00:25 +0200 Subject: [PATCH] finished unit test for Banking --- src/me/teridax/jcash/banking/BankTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/me/teridax/jcash/banking/BankTest.java b/src/me/teridax/jcash/banking/BankTest.java index 7bf5cb3..20a0909 100644 --- a/src/me/teridax/jcash/banking/BankTest.java +++ b/src/me/teridax/jcash/banking/BankTest.java @@ -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("öüäöüäöü"), "öüäöüäöü"); } }