Skip to content

Commit

Permalink
Fix BrazilianPhoneNumber extension
Browse files Browse the repository at this point in the history
  • Loading branch information
natenho committed Dec 31, 2022
1 parent 5c0c1be commit e29cd12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/Mockaco.AspNetCore/Plugins/PhoneNumberExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
namespace Bogus
{
// TODO Move to plugin
internal static class PhoneNumberExtensions
public static class PhoneNumberExtensions
{
public static string BrazilianPhoneNumber(this PhoneNumbers phoneNumbers)
{
var faker = new Faker("pt_BR");
string[] brazilianAreaCodes = { "11", "12", "13", "14", "15", "16", "17", "18", "19", "21", "22", "24", "27", "28", "31", "32", "33", "34", "35", "37", "38", "41", "42", "43", "44", "45", "46", "47", "48", "49", "51", "53", "54", "55", "61", "62", "63", "64", "65", "66", "67", "68", "69", "71", "73", "74", "75", "77", "79", "81", "82", "83", "84", "85", "86", "87", "88", "89", "91", "92", "93", "94", "95", "96", "97", "98", "99" };
var areaCode = faker.PickRandom(brazilianAreaCodes);
var sufix = faker.Random.Number(50000000, 99999999);

return $"{areaCode}9{sufix}";
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Mockaco.AspNetCore/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Microsoft.AspNetCore.Builder.MockacoApplicationBuilder
Bogus.PhoneNumberExtensions
Microsoft.AspNetCore.Builder.MockacoApplicationBuilder
Microsoft.Extensions.DependencyInjection.MockacoServiceCollection
Mockaco.IFakerFactory
Mockaco.IFakerFactory.GetDefaultFaker() -> Bogus.Faker
Expand Down Expand Up @@ -102,6 +103,7 @@ Mockaco.TemplateFileProviderOptions.Path.get -> string
Mockaco.TemplateFileProviderOptions.Path.set -> void
Mockaco.TemplateFileProviderOptions.TemplateFileProviderOptions() -> void
override Mockaco.Mock.ToString() -> string
static Bogus.PhoneNumberExtensions.BrazilianPhoneNumber(this Bogus.DataSets.PhoneNumbers phoneNumbers) -> string
static Microsoft.AspNetCore.Builder.MockacoApplicationBuilder.UseMockaco(this Microsoft.AspNetCore.Builder.IApplicationBuilder app) -> Microsoft.AspNetCore.Builder.IApplicationBuilder
static Microsoft.AspNetCore.Builder.MockacoApplicationBuilder.UseMockaco(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> configure) -> Microsoft.AspNetCore.Builder.IApplicationBuilder
static Microsoft.Extensions.DependencyInjection.MockacoServiceCollection.AddMockaco(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
Expand Down

0 comments on commit e29cd12

Please sign in to comment.