Skip to content

Commit

Permalink
🔨 Fixes #192: Fixed IndexOutOfRangeException when `Company.CompanyNam…
Browse files Browse the repository at this point in the history
…e()` is used with `az` locale.
  • Loading branch information
bchavez committed Dec 11, 2018
1 parent 3f1399b commit cc103fd
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v25.0.2
* Issue 192: Fixed IndexOutOfRangeException when `Company.CompanyName()` is used with `az` locale.

## v25.0.1
* Add SourceLink compatibility with Visual Studio 2017.
* Obsoleted **LoremPixel.com** `Image` categories. The image service is usually down or very slow. Consider using `Images.PicsumUrl()` as a replacement. This version is an obsolete-warn, next release will have Image category APIs removed.
Expand Down
26 changes: 26 additions & 0 deletions Source/Bogus.Tests/GitHubIssues/Issue192.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;

namespace Bogus.Tests.GitHubIssues
{
public class Issue192 : SeededTest
{

[Fact]
public void no_company_suffix_should_not_throw()
{
var f = new Faker("az");
var s = f.Random.ArrayElement(f.Company.Suffixes());
s.Should().Be("Holdinqlər");
}

[Fact]
public void company_name_should_work_in_az()
{
var f = new Faker("az");

f.Company.CompanyName(0).Should().Be("Əfəndiyeva Holdinqlər");
}
}
}
Binary file modified Source/Bogus/data/az.locale.bson
Binary file not shown.
5 changes: 4 additions & 1 deletion Source/Bogus/data/az.locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,10 @@
"MMC",
"QSC"
],
"suffix": [],
"suffix": [
"Qrup",
"Holdinqlər"
],
"name": [
"#{prefix} #{Name.female_first_name}",
"#{prefix} #{Name.male_first_name}",
Expand Down
8 changes: 8 additions & 0 deletions Source/Bogus/data_extend/az.locale.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"company": {
"suffix": [
"Qrup",
"Holdinqlər"
]
}
}
6 changes: 6 additions & 0 deletions Source/Builder/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ gulp.task("import.locales.json", function () {

ensureAllArraysAreStrings(locale);

specializeLocale(locale, localeCode);

var destName = localeCode + ".locale.json";
log2(destName);
var bogusLocale = {};
Expand Down Expand Up @@ -141,6 +143,10 @@ function transformMimeTypes(obj) {
obj["system"]["mimeTypes"] = arr;
}

function specializeLocale(locale, localeCode) {

}


//Helper Methods
function log(msg) {
Expand Down

0 comments on commit cc103fd

Please sign in to comment.