public void RenavamMustHaveOnlyNumbers() { RenavamValidator validator = new RenavamValidator(); Assert.IsFalse(validator.IsEligible("99999999x")); Assert.IsFalse(validator.IsEligible("9999999 9")); }
public void OnlyRenavamWithNineOrElevenDigitsAreEligible() { RenavamValidator validator = new RenavamValidator(); Assert.IsTrue(validator.IsEligible(renavamWithNineDigits)); Assert.IsTrue(validator.IsEligible(renavamWithLessThenElevenDigits)); Assert.IsFalse(validator.IsEligible(renavamWithMoreThenElevenDigits)); }
public void ShouldConsiderAValidUnformattedRenavamAsEligible() { RenavamValidator validator = new RenavamValidator(); Assert.IsTrue(validator.IsEligible(validUnformattedRenavam1), "Renamvam " + validUnformattedRenavam1 + " must be eligible."); Assert.IsTrue(validator.IsEligible(validUnformattedRenavam2)); Assert.IsTrue(validator.IsEligible(renavamUnformattedWithInvalidCheckDigit)); }
public void ShouldConsiderAValidFormattedRenavamAsEligible() { RenavamValidator validator = new RenavamValidator(true); Assert.IsTrue(validator.IsEligible(validFormattedRenavam1)); Assert.IsTrue(validator.IsEligible(validFormattedRenavam2)); Assert.IsTrue(validator.IsEligible(renavamFormattedWithInvalidCheckDigit)); }