Skip to content

Commit

Permalink
Merge pull request #34 from lira92/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
lira92 authored Feb 11, 2021
2 parents 0910d57 + 5eb5c2b commit 5bb6f8b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "3.1.300"
"version": "3.1.404"
}
}
}
6 changes: 3 additions & 3 deletions src/Flunt.Br/Flunt.Br.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.4.0</Version>
<Version>1.4.1</Version>
<Authors>Alan Lira</Authors>
<Description>Extensions of Flunt for Brazilian projects</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/lira92/flunt.br</PackageProjectUrl>
<RepositoryUrl>https://github.com/lira92/flunt.br</RepositoryUrl>
<AssemblyVersion>1.4.0.0</AssemblyVersion>
<FileVersion>1.4.0.0</FileVersion>
<AssemblyVersion>1.4.1.0</AssemblyVersion>
<FileVersion>1.4.1.0</FileVersion>
<PackageIcon>flunt-icon-br_compressed.png</PackageIcon>
<PackageTags>Validation;Flunt.Br;Flunt;Cnpj;Cpf;Telefone;Cep</PackageTags>
</PropertyGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/Flunt.Br/Validations/Cpf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public bool Validate(string value)
int resto;
value = value.Trim();
value = value.Replace(".", "").Replace("-", "");
if(!long.TryParse(value, out var parsed))
return false;
if (value.Length != 11 || cpfInvalid.Contains(value))
return false;
tempCpf = value.Substring(0, 9);
Expand All @@ -43,4 +45,4 @@ public bool Validate(string value)
return value.EndsWith(digito);
}
}
}
}
1 change: 1 addition & 0 deletions tests/Flunt.Br.Tests/PersonContractTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class PersonContractTest
[DataRow("777.777.777-77")]
[DataRow("888.888.888-88")]
[DataRow("999.999.999-99")]
[DataRow("999.999.abc-99")]
[DataRow(null)]
public void IsCpf_Invalid(string value)
{
Expand Down

0 comments on commit 5bb6f8b

Please sign in to comment.