Esempio n. 1
0
        public override ValidationResults <String> ValidateData(ProcessedDataPackage package)
        {
            ValidationResults <String> results = new ValidationResults <String>();

            results.Score = -1;

            DownloadData data = package.GetData <DownloadData>();

            if (data == null || data.Count == 0)
            {
                return(results);
            }

            results.Score = 100;

            foreach (DownloadState ds in data)
            {
                try{
                    Uri u = new Uri(ds.URL);
                    if (results.Contains(u.Host.Trim().ToLower()) == false)
                    {
                        results.Add(u.Host);
                    }
                }
                catch
                {
                }
            }

            results.ResultsExplenation = message;

            int c = 0;

            for (int xx = 0; xx < grades.Length; xx++)
            {
                if (grades[xx] < results.Count)
                {
                    c++;
                }
                else
                {
                    break;
                }
            }
            results.Score -= c * 10;

            return(results);
        }