Exemplo n.º 1
0
        public void IsValid_WithInvalidFormat_ThrowsFormatException(string nit)
        {
            //Arrange
            var validator = new CuiValidator();

            //Act
            TestDelegate actionToExecute = () => validator.IsValid(nit);

            //Assert
            Assert.That(actionToExecute, Throws.TypeOf <FormatException>());
        }
Exemplo n.º 2
0
        public void IsValid_WithValidFormat_CheckResults(string cui, bool expectedResult)
        {
            //Arrange
            CuiValidator validator = new CuiValidator();

            //Act
            bool result = validator.IsValid(cui);

            //Assert
            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 3
0
        public void IsValid_WithNullCui_ThrowsArgumentNullException()
        {
            //Arrange
            var validator = new CuiValidator();

            //Act
            TestDelegate actionToExecute = () => validator.IsValid(null);

            //Assert
            Assert.That(actionToExecute, Throws.InstanceOf <ArgumentNullException>().And.Message.ContainsSubstring("cui"));
        }