Created
November 4, 2016 09:00
-
-
Save danmux/cbe74e643538bb0ff9c2bf78511d630e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package iban | |
import ( | |
"testing" | |
"libs/hbci/iban/assert" | |
) | |
func TestParseIbanAsser(t *testing.T) { | |
// Valid IBAN | |
iban, err := Parse("DE10123") | |
assert.Equal(t, iban.CountryCode, "DE") | |
assert.Equal(t, iban.CheckDigits, "10") | |
assert.Equal(t, iban.Bban, "123") | |
assert.Nil(t, err) | |
// Invalid IBAN | |
iban, err = Parse("DE10") | |
assert.Equal(t, iban.CountryCode, "") | |
assert.Equal(t, iban.CheckDigits, "") | |
assert.Equal(t, iban.Bban, "") | |
assert.NotNil(t, err) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment