Exemplo n.º 1
0
        protected override ValidatorResult Evaluate()
        {
            Item item = this.GetItem();

            if (item != null)
            {
                SiteInfo site = _siteProvider.GetSiteFromSiteItem(item);

                if (site != null)
                {
                    int urlLength = _urlLengthCalculator.GetItemUrlLength(item, site.Name);

                    bool isValidLength = _urlChecker.IsValidLength(urlLength);

                    return(Validate(isValidLength, urlLength));
                }
            }

            return(this.GetFailedResult(ValidatorResult.Unknown));
        }