예제 #1
0
        public void ValidationFailsForInvalidUrls()
        {
            UrlValidator validator = new UrlValidator();

            Assert.IsFalse(validator.IsValid(this, "http://www"));
            Assert.IsFalse(validator.IsValid(this, ".www.bbc.co.uk"));
            Assert.IsFalse(validator.IsValid(this, "ftp:///my.ftp.site"));
        }
예제 #2
0
        public override IValidator Build()
        {
            IValidator validator = new UrlValidator();

            ConfigureValidatorMessage(validator);

            return validator;
        }
예제 #3
0
        public void ValidationPassesForValidUrls()
        {
            UrlValidator validator = new UrlValidator();

            Assert.IsTrue(validator.IsValid(this, "http://www.castleproject.org"));
            Assert.IsTrue(validator.IsValid(this, "http://www.bbc.co.uk"));
            Assert.IsTrue(validator.IsValid(this, "ftp://my.ftp.site"));
            Assert.IsTrue(validator.IsValid(this, "http://www.tickets.com/file.extension?id=something"));
        }