public void ValidateField_ReturnsCorrectValidationStatus(string input, bool expected)
        {
            //arrange
            var validator = new HeightValidator();

            //act
            var actual = validator.FieldIsValid(input);

            //assert
            Assert.Equal(expected, actual);
        }
        public void CanValidateHeight()
        {
            Person w1 = new Person {
                Height = 1.6f
            };
            Person m1 = new Person {
                Height = 1.69f
            };
            Person w2 = new Person {
                Height = 1.60f
            };
            Person m2 = new Person {
                Height = 1.71f
            };

            HeightValidator validator = new HeightValidator();

            Assert.False(validator.Matched(w1, m1));
            Assert.True(validator.Matched(w2, m2));
        }
Beispiel #3
0
        public bool Test_HeightValidator(string value)
        {
            var validator = new HeightValidator();

            return(validator.Validate(value));
        }
        public bool WhenHeightIsValue_ThenValidatorSucceedsOrFails(string height)
        {
            var validator = new HeightValidator();

            return(validator.IsValid(new BodyMassIndexReport(height, string.Empty)));
        }