예제 #1
0
        public void WhenLinhaDigitavelMaskIsInValidThenValidateMaskShouldReturnTrue(string mask)
        {
            //Act
            bool validMask = BoletoUtil.ValidateMask(mask);

            Assert.IsFalse(validMask);
        }
예제 #2
0
        public void WhenValidLinhaDigitavelWithMaskThenShouldReturnTrue(string boleto)
        {
            //Act
            bool result = BoletoUtil.ValidateBoleto(boleto);

            //Assert
            Assert.IsTrue(result);
        }
예제 #3
0
        public void WhenLinhaDigitavelIsInvalidWithMaskThenShouldReturnFalse(string linhaDigitavel)
        {
            //Act
            bool result = BoletoUtil.ValidateBoleto(linhaDigitavel);

            //Assert
            Assert.IsFalse(result);
        }
예제 #4
0
        public void WhenLinhaDigitavelLengthIsGreaterThan47CharThenShouldReturnFalse()
        {
            //Arrange
            var linhaDigitavel = new string('0', 48);;

            //Act
            bool result = BoletoUtil.ValidateBoleto(linhaDigitavel);

            //Assert
            Assert.IsFalse(result);
        }
예제 #5
0
        public void WhenLinhaDigitavelLengthIsLessThan47CharThenShouldReturnFalse()
        {
            //Arrange
            var linhaDigitavel = "123456789";

            //Act
            bool result = BoletoUtil.ValidateBoleto(linhaDigitavel);

            //Assert
            Assert.IsFalse(result);
        }
예제 #6
0
 public void WhenLinhaDigitavelIsNullThenValidateMaskShouldThrowArgumentNullException()
 {
     Assert.ThrowsException <ArgumentNullException>(() => BoletoUtil.ValidateMask(null));
 }
예제 #7
0
 public void WhenLinhaDigitavelLengthIsLessThan47ThenGenerateBarCodeTextShouldThrowArgumentOutOfRangeException()
 {
     Assert.ThrowsException <ArgumentOutOfRangeException>(() => BoletoUtil.GenerateBarCodeText("1234567890"));
 }
예제 #8
0
 public void WhenLinhaDigitavelLengthIsGreaterThan47ThenGenerateBarCodeTextShouldThrowArgumentOutOfRangeException()
 {
     Assert.ThrowsException <ArgumentOutOfRangeException>(() => BoletoUtil.GenerateBarCodeText(new string('0', 48)));
 }
예제 #9
0
 public void WhenLinhaDigitavelIsNullThenGenerateBarCodeTextShouldThrowArgumentNullException()
 {
     Assert.ThrowsException <ArgumentNullException>(() => BoletoUtil.GenerateBarCodeText(null));
 }
예제 #10
0
 public void WhenNullLinhaDigitavelThenShouldThrowArgumentNullException()
 {
     //Act
     Assert.ThrowsException <ArgumentNullException>(() => BoletoUtil.ValidateBoleto(null));
 }