Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajustes na validação da IE do Maranhão; #27

Merged
merged 1 commit into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Ajustes na validação da IE do Maranhão;
  • Loading branch information
WalissonPires committed Nov 23, 2021
commit 5f335ca590098240256897038dd3f81bee7a074f
3 changes: 2 additions & 1 deletion DocsBr.Tests/IEMaranhaoValidatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public class IEMaranhaoValidatorTests : IEValidatorTests
//private static string[] validValues = {
// "12.074072-9", "12000038-5", "12.233602-0", "12404921-4",
// "12138560-4", "12479458-0", "12046931-6", "12708673-0",
// "12138560-4", "12996677-0", "12957307-8", "12565693-9"
// "12138560-4", "12996677-0", "12957307-8", "12565693-9",
// "12.524713-3", "12509156-7", "12358596-1", "12659067-2"
//};
private static string[] validValues = { "12.233602-0" };
private static string[] invalidValues = { "12.074072-5", "12000038-0" };
Expand Down
5 changes: 2 additions & 3 deletions DocsBr/Validation/IE/IEMaranhaoValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace DocsBr.Validation.IE
/// Validação da IE de Maranhão
/// </summary>
/// <remarks>
/// ROTEIRO DE CRÍTICA DA INSCRIÇÃO ESTADUAL:
/// ROTEIRO DE CRÍTICA DA INSCRIÇÃO ESTADUAL:
/// http://www.sintegra.gov.br/Cad_Estados/cad_MA.html
/// </remarks>
public class IEMaranhaoValidator : IIEValidator
Expand Down Expand Up @@ -42,9 +42,8 @@ private bool HasValidCheckDigits()
string number = this.inscEstadual.Substring(0, this.inscEstadual.Length - 1);

DigitoVerificador digitoVerificador = new DigitoVerificador(number)
.SemComplementarDoModulo()
.ComMultiplicadoresDeAte(2, 9)
.Substituindo("0", 0, 1, 10);
.Substituindo("0", 11, 10);

return digitoVerificador.CalculaDigito() == this.inscEstadual.Substring(this.inscEstadual.Length - 1, 1);
}
Expand Down