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() {
        assertNotEquals(Bank.validateBlz("öüäöüäöü"), "öüäöüäöü");
    }
}
