public void PathNotExist(string pathName, string pathValue)
        {
            PathExistsValidator val = this.CreateValidator(pathName, false);
            Task task = ValidatorTestSetup.CreateTask("someTask", new string[] { pathName }, new string[] { pathValue });
            IEnumerable <ValidationResult> results = val.Evaluate(new Task[] { task });

            Assert.Contains(results, r => r.State == ValidatorState.Error);
            Assert.DoesNotContain(results, r => r.State == ValidatorState.Success);
        }
Ejemplo n.º 2
0
        public void SolrNotAvailable(string hostName, string hostValue)
        {
            HostAvaiableValidator val = this.CreateValidator(HttpStatusCode.NotFound, hostName);
            Task task = ValidatorTestSetup.CreateTask("someTask", new string[] { hostName }, new string[] { hostValue });
            IEnumerable <ValidationResult> results = val.Evaluate(new Task[] { task });

            Assert.Contains(results, r => r.State == ValidatorState.Error);
            Assert.DoesNotContain(results, r => r.State == ValidatorState.Success);
        }
        public void CoreWithTheSamePrefixDoesNotExist(string prefixValue, string PrefixName, string solrValue, string solrName, string[] coresToReturn)
        {
            //setup
            CorePrefixDoesNotExistValidator val = this.CreateValidator(prefixValue, PrefixName, solrValue, solrName, coresToReturn);
            Task task = ValidatorTestSetup.CreateTask("someTask", new string[] { PrefixName, solrName }, new string[] { prefixValue, solrValue });
            //act
            IEnumerable <ValidationResult> results = val.Evaluate(new Task[] { task });

            Assert.Contains(results, r => r.State == ValidatorState.Success);
            Assert.DoesNotContain(results, r => r.State == ValidatorState.Error);
        }