[
{ "name": "an 8-character BIC is the primary office, branch XXX", "args": ["DEUTDEFF"], "expect": { "valid": true, "normalised": "DEUTDEFF", "institution": "DEUT", "country": "DE", "location": "FF", "branch": "XXX", "reason": null } },
{ "name": "an 11-character BIC with a branch", "args": ["DEUTDEFF500"], "expect": { "valid": true, "normalised": "DEUTDEFF500", "institution": "DEUT", "country": "DE", "location": "FF", "branch": "500", "reason": null } },
{ "name": "the explicit primary office keeps its 11 characters", "args": ["NEDSZAJJXXX"], "expect": { "valid": true, "normalised": "NEDSZAJJXXX", "institution": "NEDS", "country": "ZA", "location": "JJ", "branch": "XXX", "reason": null } },
{ "name": "a UK BIC with a digit in the location", "args": ["NWBKGB2L"], "expect": { "valid": true, "normalised": "NWBKGB2L", "institution": "NWBK", "country": "GB", "location": "2L", "branch": "XXX", "reason": null } },
{ "name": "lower case and spaces are normalised", "args": [" nwbk gb 2l "], "expect": { "valid": true, "normalised": "NWBKGB2L", "institution": "NWBK", "country": "GB", "location": "2L", "branch": "XXX", "reason": null } },
{ "name": "a lettered branch code", "args": ["DSBACNBXSHA"], "expect": { "valid": true, "normalised": "DSBACNBXSHA", "institution": "DSBA", "country": "CN", "location": "BX", "branch": "SHA", "reason": null } },
{ "name": "digits in the institution prefix are allowed since ISO 9362:2014", "args": ["1234GB2L"], "expect": { "valid": true, "normalised": "1234GB2L", "institution": "1234", "country": "GB", "location": "2L", "branch": "XXX", "reason": null } },
{ "name": "a digit in the country code is refused", "args": ["NWBK9B2L"], "expect": { "valid": false, "normalised": null, "institution": null, "country": null, "location": null, "branch": null, "reason": "bad-country" } },
{ "name": "seven characters is too short", "args": ["NWBKGB2"], "expect": { "valid": false, "normalised": null, "institution": null, "country": null, "location": null, "branch": null, "reason": "bad-length" } },
{ "name": "nine characters is neither 8 nor 11", "args": ["NWBKGB2L1"], "expect": { "valid": false, "normalised": null, "institution": null, "country": null, "location": null, "branch": null, "reason": "bad-length" } },
{ "name": "twelve characters, a SWIFTNet terminal address, is not a BIC", "args": ["DEUTDEFFA500"], "expect": { "valid": false, "normalised": null, "institution": null, "country": null, "location": null, "branch": null, "reason": "bad-length" } },
{ "name": "hyphens are not accepted separators", "args": ["NWBK-GB-2L"], "expect": { "valid": false, "normalised": null, "institution": null, "country": null, "location": null, "branch": null, "reason": "bad-character" } },
{ "name": "an accented letter is a bad character", "args": ["DEUTDÉFF"], "expect": { "valid": false, "normalised": null, "institution": null, "country": null, "location": null, "branch": null, "reason": "bad-character" } },
{ "name": "the empty string", "args": [""], "expect": { "valid": false, "normalised": null, "institution": null, "country": null, "location": null, "branch": null, "reason": "empty" } },
{ "name": "a non-string is empty, not an exception", "args": [12345678], "expect": { "valid": false, "normalised": null, "institution": null, "country": null, "location": null, "branch": null, "reason": "empty" } }
]