Ejemplo n.º 1
0
        public void CanParseToInt32_CorrectNumber_True()
        {
            //arrange
            string line         = Int32.MaxValue.ToString();
            bool   onlyPositive = false;

            //act
            bool result = BaseValidator.CanParseToInt32(line, onlyPositive);

            //assert
            Assert.True(result);
        }
Ejemplo n.º 2
0
        public void CanParseToInt32_OnlyPositiveNegativeNumber_False()
        {
            //arrange
            string line         = "-10";
            bool   onlyPositive = true;

            //act
            bool result = BaseValidator.CanParseToInt32(line, onlyPositive);

            //assert
            Assert.False(result);
        }
Ejemplo n.º 3
0
        public void CanParseToInt32_TooBigNumber_False()
        {
            //arrange
            string line         = (Int32.MaxValue).ToString() + "0";
            bool   onlyPositive = false;

            //act
            bool result = BaseValidator.CanParseToInt32(line, onlyPositive);

            //assert
            Assert.False(result);
        }
Ejemplo n.º 4
0
        public void CanParseToInt32_Null_False()
        {
            //arrange
            string line         = null;
            bool   onlyPositive = false;

            //act
            bool result = BaseValidator.CanParseToInt32(line, onlyPositive);

            //assert
            Assert.False(result);
        }