Skip to content

Commit

Permalink
Updated to latest faker-js@5478d65 (bchavez#356)
Browse files Browse the repository at this point in the history
* Updated to latest faker-js@5478d65
* `nep` locale renamed to `ne`.
* `de` locale; `Date` dataset changed.
* `es` locale; gender names added.
* `fr` locale; `Date` dataset changed.
* `nb_NO` locale; gender names added.
* `nl` locale; `Address`, `Commerce`, `Date`, `Hacker`, `Internet` datasets changed; gender names added.
* `pt_BR` locale; gender names added.
* `tr` locale; gender names added.
* `vi` locale; gender names added. `Date`, `Lorem`, datasets changed.
* Added `Internet.Port()`; generate port numbers from 1 to 65535.

* Remove au_ocker locale.

* Add au_ocker locale.

* Fix NL unit test.
  • Loading branch information
bchavez authored Feb 7, 2021
1 parent 762ce71 commit bf15eee
Show file tree
Hide file tree
Showing 32 changed files with 8,895 additions and 4,898 deletions.
15 changes: 15 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## v33.0.1
Release Date: 2021-02-07

* Locale data parity with faker-js@5478d65.
* `nep` locale renamed to `ne`.
* `de` locale; `Date` dataset changed.
* `es` locale; gender names added.
* `fr` locale; `Date` dataset changed.
* `nb_NO` locale; gender names added.
* `nl` locale; `Address`, `Commerce`, `Date`, `Hacker`, `Internet` datasets changed; gender names added.
* `pt_BR` locale; gender names added.
* `tr` locale; gender names added.
* `vi` locale; gender names added. `Date`, `Lorem`, datasets changed.
* Added `Internet.Port()`; generate port numbers from 1 to 65535.

## v32.1.1
Release Date: 2021-01-31

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ public void With_Korean_Locale()
|`de_CH `|German (Switzerland) ||`ko `|Korean |
|`el `|Greek ||`lv `|Latvian |
|`en `|English ||`nb_NO `|Norwegian |
|`en_AU `|English (Australia) ||`nep `|Nepalese |
|`en_au_ocker `|English (Australia Ocker) ||`nl `|Dutch |
|`en_AU `|English (Australia) ||`ne `|Nepalese |
|`en_AU_ocker `|English (Australia Ocker) ||`nl `|Dutch |
|`en_BORK `|English (Bork) ||`nl_BE `|Dutch (Belgium) |
|`en_CA `|English (Canada) ||`pl `|Polish |
|`en_GB `|English (Great Britain) ||`pt_BR `|Portuguese (Brazil) |
Expand Down Expand Up @@ -384,6 +384,7 @@ In the examples above, all three alternative styles of using **Bogus** produce t
* `DomainWord` - Generates a domain word used for domain names.
* `DomainSuffix` - Generates a domain name suffix like .com, .net, .org
* `Ip` - Gets a random IPv4 address string.
* `Port` - Generates a random port number.
* `IpAddress` - Gets a random IPv4 IPAddress type.
* `IpEndPoint` - Gets a random IPv4 IPEndPoint.
* `Ipv6` - Generates a random IPv6 address string.
Expand Down
10 changes: 10 additions & 0 deletions Source/Bogus.Tests/DataSetTests/InternetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using Bogus.DataSets;
using FluentAssertions;
using Xunit;
Expand Down Expand Up @@ -180,5 +181,14 @@ public void can_get_username_with_unicode_characters(string first, string last,
internet.Random = new Randomizer(seed);
internet.UserNameUnicode(first, last).Should().Be(expected);
}

[Fact]
public void can_generate_random_port_number()
{
internet.Port().Should()
.BeGreaterOrEqualTo(IPEndPoint.MinPort + 1)
.And
.BeLessOrEqualTo(IPEndPoint.MaxPort);
}
}
}
6 changes: 3 additions & 3 deletions Source/Bogus.Tests/GitHubIssues/Issue132.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ public void id_ID_locale()
}

[Fact]
public void nep_locale()
public void ne_locale()
{
CultureInfo.GetCultureInfo("ne-NP")
.ToBogusLocale()
.Should().Be("nep");
.Should().Be("ne");

CultureInfo.GetCultureInfo("ne")
.ToBogusLocale()
.Should().Be("nep");
.Should().Be("ne");
}

[Fact]
Expand Down
16 changes: 16 additions & 0 deletions Source/Bogus.Tests/GitHubIssues/Issue355.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Bogus.DataSets;
using FluentAssertions;
using Xunit;

namespace Bogus.Tests.GitHubIssues
{
public class Issue355 : SeededTest
{
[Fact]
public void pt_BR_has_gendered_names()
{
var n = new Name("pt_BR");
n.SupportsGenderFirstNames.Should().BeTrue();
}
}
}
2 changes: 1 addition & 1 deletion Source/Bogus.Tests/GitHubIssues/PullRequest194.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void can_generate_nl_locale_with_modifications()
"en Zonen"
});

f.Name.FirstName().Should().Be("Fons");
f.Name.FirstName().Should().Be("Bram");
}
}
}
9 changes: 9 additions & 0 deletions Source/Bogus/DataSets/Internet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ public string Ip()
return $"{Random.Number(1, 255)}.{Random.Number(255)}.{Random.Number(255)}.{Random.Number(255)}";
}

/// <summary>
/// Generates a random port number.
/// </summary>
/// <returns>A random port number</returns>
public int Port()
{
return this.Random.Number(min: IPEndPoint.MinPort + 1, max: IPEndPoint.MaxPort);
}

/// <summary>
/// Gets a random IPv4 IPAddress type.
/// </summary>
Expand Down
2 changes: 0 additions & 2 deletions Source/Bogus/Extensions/ExtensionsForCultureInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public static class ExtensionsForCultureInfo
{"cs", "cz"},
{"en-IN", "en_IND"},
{"ka", "ge"},
{"ne", "nep"},
{"id", "id_ID"},
{"nb", "nb_NO"},
{"nn", "nb_NO"}
Expand All @@ -31,7 +30,6 @@ public static string ToBogusLocale(this CultureInfo ci)
cs -> cz
en-IN -> en_IND
ka -> ge
ne -> nep
id -> id_ID
nb,nn -> nb_NO
Expand Down
Binary file modified Source/Bogus/data/de.locale.bson
Binary file not shown.
98 changes: 98 additions & 0 deletions Source/Bogus/data/de.locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -5693,5 +5693,103 @@
"+49-1##-#######",
"+49-1###-########"
]
},
"date": {
"month": {
"wide": [
"Januar",
"Februar",
"März",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Dezember"
],
"wide_context": [
"Januar",
"Februar",
"März",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Dezember"
],
"abbr": [
"Jan",
"Feb",
"Mrz",
"Apr",
"Mai",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dez"
],
"abbr_context": [
"Jan",
"Feb",
"Mrz",
"Apr",
"Mai",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dez"
]
},
"weekday": {
"wide": [
"Sonntag",
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag"
],
"wide_context": [
"Sonntag",
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag"
],
"abbr": [
"So.",
"Mo.",
"Di.",
"Mi.",
"Do.",
"Fr.",
"Sa."
],
"abbr_context": [
"So.",
"Mo.",
"Di.",
"Mi.",
"Do.",
"Fr.",
"Sa."
]
}
}
}
File renamed without changes.
File renamed without changes.
Binary file modified Source/Bogus/data/es.locale.bson
Binary file not shown.
31 changes: 31 additions & 0 deletions Source/Bogus/data/es.locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,37 @@
"Zepeda",
"Zúñiga"
],
"male_first_name": [
"Josep",
"Ángel",
"Daniel",
"Manuel",
"Pedro",
"Salvador",
"Rubén",
"Iván",
"Miguel",
"Jorge",
"Sergi",
"Josep",
"Ricardo",
"Carles",
"Jordi",
"Manuel"
],
"female_first_name": [
"Marta",
"Andrea",
"Ana",
"Anni",
"Laura",
"Maica",
"Laura",
"Lorena",
"Matilde",
"Jennifer",
"Roser"
],
"prefix": [
"Sr.",
"Sra.",
Expand Down
Binary file modified Source/Bogus/data/fr.locale.bson
Binary file not shown.
98 changes: 98 additions & 0 deletions Source/Bogus/data/fr.locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -2159,5 +2159,103 @@
"+33 6########",
"+33 7########"
]
},
"date": {
"month": {
"wide": [
"janvier",
"février",
"mars",
"avril",
"mai",
"juin",
"juillet",
"août",
"septembre",
"octobre",
"novembre",
"décembre"
],
"wide_context": [
"janvier",
"février",
"mars",
"avril",
"mai",
"juin",
"juillet",
"août",
"septembre",
"octobre",
"novembre",
"décembre"
],
"abbr": [
"janv.",
"févr.",
"mars",
"avril",
"mai",
"juin",
"juil.",
"août",
"sept.",
"oct.",
"nov.",
"déc."
],
"abbr_context": [
"janv.",
"févr.",
"mars",
"avril",
"mai",
"juin",
"juil.",
"août",
"sept.",
"oct.",
"nov.",
"déc."
]
},
"weekday": {
"wide": [
"Dimanche",
"Lundi",
"Mardi",
"Mercredi",
"Jeudi",
"Vendredi",
"Samedi"
],
"wide_context": [
"Dimanche",
"Lundi",
"Mardi",
"Mercredi",
"Jeudi",
"Vendredi",
"Samedi"
],
"abbr": [
"Dim",
"Lun",
"Mar",
"Mer",
"Jeu",
"Ven",
"Sam"
],
"abbr_context": [
"Dim",
"Lun",
"Mar",
"Mer",
"Jeu",
"Ven",
"Sam"
]
}
}
}
Binary file modified Source/Bogus/data/nb_NO.locale.bson
Binary file not shown.
Loading

0 comments on commit bf15eee

Please sign in to comment.