Example #1
0
        public void RenavamMustHaveOnlyNumbers()
        {
            RenavamValidator validator = new RenavamValidator();

            Assert.IsFalse(validator.IsEligible("99999999x"));
            Assert.IsFalse(validator.IsEligible("9999999 9"));
        }
Example #2
0
        public void OnlyRenavamWithNineOrElevenDigitsAreEligible()
        {
            RenavamValidator validator = new RenavamValidator();

            Assert.IsTrue(validator.IsEligible(renavamWithNineDigits));
            Assert.IsTrue(validator.IsEligible(renavamWithLessThenElevenDigits));
            Assert.IsFalse(validator.IsEligible(renavamWithMoreThenElevenDigits));
        }
Example #3
0
        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));
        }
Example #4
0
        public void ShouldConsiderAValidFormattedRenavamAsEligible()
        {
            RenavamValidator validator = new RenavamValidator(true);

            Assert.IsTrue(validator.IsEligible(validFormattedRenavam1));
            Assert.IsTrue(validator.IsEligible(validFormattedRenavam2));
            Assert.IsTrue(validator.IsEligible(renavamFormattedWithInvalidCheckDigit));
        }