public void NumberValidator_WhenNumeric_IsValid()
        {
            const string INPUT           = "1";
            const bool   EXPECTED_RESULT = true;

            bool result = _validator.IsValid(INPUT);

            Assert.AreEqual(EXPECTED_RESULT, result);
        }
Esempio n. 2
0
        public void IsNumber_WithLettersFails()
        {
            var numVal = new NumberValidator();

            var result = numVal.IsValid("1a234.12", "Temp");

            Assert.IsFalse(result);
        }
Esempio n. 3
0
        public void IsNumber_WithIntegerWorks()
        {
            var numVal = new NumberValidator();

            var result = numVal.IsValid("123", "Temp");

            Assert.IsTrue(result);
        }
Esempio n. 4
0
        public void IsNumber_WithDecimalWorks()
        {
            var numVal = new NumberValidator();

            var result = numVal.IsValid("1234.12", "Temp");

            Assert.IsTrue(result);
        }
Esempio n. 5
0
        public void Valid_Number_Should_Return_IsValid_True()
        {
            var validator = new NumberValidator();

            var result = validator.IsValid("345882865");

            Assert.True(result);
        }
        public void IsValid_Wrong_Data_AssertFalse()
        {
            NumberValidator val = new NumberValidator();

            Assert.False(val.IsValid("0s7294835a7"));
        }
        public void IsValid_Correct_Data_AssertTrue()
        {
            NumberValidator val = new NumberValidator();

            Assert.True(val.IsValid("0172-9483597"));
        }
Esempio n. 8
0
        public void IsValid_Wrong_Data_AssertFalse()
        {
            NumberValidator val = new NumberValidator();

            Assert.False(val.IsValid("rm.matis.com"));
        }
Esempio n. 9
0
        public void Short_Number_Should_Return_IsValid_False()
        {
            var validator = new NumberValidator();

            Assert.False(validator.IsValid("3458"));
        }
Esempio n. 10
0
        public void IsValid_HappyPath_ReturnTrue(string number)
        {
            var isAValidNumber = _sut.IsValid(number);

            Assert.IsTrue(isAValidNumber);
        }