Esempio n. 1
0
        public void InfoWithHeadlineLessThan160CharactersIsValid()
        {
            var info = new Info();
            info.Headline = "SEVERE THUNDERSTORM WARNING ";

            var headlineValidator = new HeadlineValidator(info);
            Assert.True(headlineValidator.IsValid);
        }
Esempio n. 2
0
        public void InfoWithHeadlineLongerThan160CharactersIsInvalid()
        {
            var info = new Info();
            info.Headline = "SEVERE THUNDERSTORM WARNING SEVERE THUNDERSTORM WARNING SEVERE THUNDERSTORM WARNING SEVERE THUNDERSTORM WARNING SEVERE THUNDERSTORM WARNING SEVERE THUNDERSTORM WARNING SEVERE THUNDERSTORM WARNING SEVERE THUNDERSTORM WARNING SEVERE THUNDERSTORM WARNING ";

            var headlineValidator = new HeadlineValidator(info);
            Assert.False(headlineValidator.IsValid);
            Assert.Equal(typeof(HeadlineError), headlineValidator.Errors.ElementAt(0).GetType());
        }