diff --git a/Source/Bogus.Tests/GitHubIssues/Issue538.cs b/Source/Bogus.Tests/GitHubIssues/Issue538.cs new file mode 100644 index 00000000..53c8175d --- /dev/null +++ b/Source/Bogus.Tests/GitHubIssues/Issue538.cs @@ -0,0 +1,25 @@ +using Bogus.DataSets; +using FluentAssertions; +using Xunit; + +namespace Bogus.Tests.GitHubIssues; + +public class Issue538 : SeededTest +{ + [Fact] + public void can_generate_valid_costa_rican_iban() + { + // Costa Rican IBANs should match the following format: + // https://bank-code.net/iban/structure/costa-rica-international-bank-account-number + // e.g. CR05 0152 0200 1026 2840 66 + var finance = new Finance(); + var iban = finance.Iban(countryCode: "CR"); + + var countryCode = iban.Substring(0, 2); + var digitsAfterCountryCode = iban.Substring(2, 20); + + iban.Should().HaveLength(22); + countryCode.Should().Be("CR"); + digitsAfterCountryCode.Should().MatchRegex("^[0-9]{20}$"); + } +} \ No newline at end of file diff --git a/Source/Bogus/data/en.locale.bson b/Source/Bogus/data/en.locale.bson index 29ca883e..5e4c99ce 100644 Binary files a/Source/Bogus/data/en.locale.bson and b/Source/Bogus/data/en.locale.bson differ diff --git a/Source/Bogus/data/en.locale.json b/Source/Bogus/data/en.locale.json index 3f451623..0865b87b 100644 --- a/Source/Bogus/data/en.locale.json +++ b/Source/Bogus/data/en.locale.json @@ -9227,8 +9227,12 @@ }, { "country": "CR", - "total": 21, + "total": 22, "bban": [ + { + "type": "n", + "count": 1 + }, { "type": "n", "count": 3 @@ -9238,7 +9242,7 @@ "count": 14 } ], - "format": "CRkk bbbc cccc cccc cccc c" + "format": "CRkk xbbb cccc cccc cccc cc" }, { "country": "HR", diff --git a/Source/Bogus/data/en.locale.schema.verified.txt b/Source/Bogus/data/en.locale.schema.verified.txt index 82e866de..70681f76 100644 --- a/Source/Bogus/data/en.locale.schema.verified.txt +++ b/Source/Bogus/data/en.locale.schema.verified.txt @@ -1090,6 +1090,10 @@ }, { bban: [ + { + count: 1, + type: n + }, { count: 3, type: n @@ -1100,8 +1104,8 @@ } ], country: CR, - format: CRkk bbbc cccc cccc cccc c, - total: 21 + format: CRkk xbbb cccc cccc cccc cc, + total: 22 }, { bban: [ diff --git a/Source/Bogus/data_extend/en.locale.json b/Source/Bogus/data_extend/en.locale.json index 87f947f4..48d1e09b 100644 --- a/Source/Bogus/data_extend/en.locale.json +++ b/Source/Bogus/data_extend/en.locale.json @@ -470,8 +470,12 @@ }, { "country": "CR", - "total": 21, + "total": 22, "bban": [ + { + "type": "n", + "count": 1 + }, { "type": "n", "count": 3 @@ -481,7 +485,7 @@ "count": 14 } ], - "format": "CRkk bbbc cccc cccc cccc c" + "format": "CRkk xbbb cccc cccc cccc cc" }, { "country": "HR",