-
-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add test for Costa Rican IBAN * Update CR IBAN format in extended locale data * run gulp importLocales, excluding AR locale * Update EN locale schema snapshot
- Loading branch information
Showing
5 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}$"); | ||
} | ||
} |
Binary file not shown.
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
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
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