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")); }
public override IValidator Build() { IValidator validator = new UrlValidator(); ConfigureValidatorMessage(validator); return validator; }
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")); }