Esempio n. 1
0
        public void TestValidate(string inputString, bool expectedResult)
        {
            // Act
            var zipCodeValidator = new SimpleZipCodeValidator();
            var actualResult     = zipCodeValidator.Validate(inputString);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
Esempio n. 2
0
        public void TestValidateUsingTestCases(string inputString, bool expectedResult)
        {
            // Act
            var zipCodeValidator = new SimpleZipCodeValidator();
            var actualResult     = zipCodeValidator.Validate(inputString);

            // Assert
            Assert.That(actualResult, Is.EqualTo(expectedResult));
        }
Esempio n. 3
0
        public void TestValidateWithSixCharStringReturnsFalse()
        {
            // Arrange
            var inputString    = "123456";
            var expectedResult = false;

            // Act
            var zipCodeValidator = new SimpleZipCodeValidator();
            var actualResult     = zipCodeValidator.Validate(inputString);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
Esempio n. 4
0
        public void TestValidateWithNegativeNumberReturnsFalse()
        {
            // Arrange
            var inputString    = "-12345";
            var expectedResult = false;

            // Act
            var zipCodeValidator = new SimpleZipCodeValidator();
            var actualResult     = zipCodeValidator.Validate(inputString);

            // Assert
            Assert.That(actualResult, Is.EqualTo(expectedResult));
        }
Esempio n. 5
0
        public void TestValidateWithAlphaCharsReturnsFalse()
        {
            // Arrange
            var inputString    = "asdf";
            var expectedResult = false;

            // Act
            var zipCodeValidator = new SimpleZipCodeValidator();
            var actualResult     = zipCodeValidator.Validate(inputString);

            // Assert
            Assert.That(actualResult, Is.EqualTo(expectedResult));
        }
Esempio n. 6
0
        public void TestValidateWithValidCodeReturnsTrue()
        {
            //
            // Arrange
            //
            var inputString    = "12345";
            var expectedResult = true;

            //
            // Act
            //
            var zipCodeValidator = new SimpleZipCodeValidator();
            var actualResult     = zipCodeValidator.Validate(inputString);

            //
            // Assert
            //
            Assert.Equal(expectedResult, actualResult);
        }