public void ReturnFailureForFileNotFound()
		{
			Validator<string> validator = new FileExistsValidator();
			ValidationResults validationResults = validator.Validate(@"C:\SomeFile");

			Assert.IsFalse(validationResults.IsValid);
		}
		public void ReturnSuccessForValidFile()
		{
			Validator<string> validator = new FileExistsValidator();
			ValidationResults validationResults = validator.Validate(Assembly.GetExecutingAssembly().Location);

			Assert.IsTrue(validationResults.IsValid);
		}
		public void ReturnFailureForNullFile()
		{
			Validator<string> validator = new FileExistsValidator();
			ValidationResults validationResults = validator.Validate(null);

			Assert.IsFalse(validationResults.IsValid);
		}
        public void ReturnSuccessForValidFile()
        {
            Validator <string> validator         = new FileExistsValidator();
            ValidationResults  validationResults = validator.Validate(Assembly.GetExecutingAssembly().Location);

            Assert.IsTrue(validationResults.IsValid);
        }
        public void ReturnFailureForFileNotFound()
        {
            Validator <string> validator         = new FileExistsValidator();
            ValidationResults  validationResults = validator.Validate(@"C:\SomeFile");

            Assert.IsFalse(validationResults.IsValid);
        }
        public void ReturnFailureForNullFile()
        {
            Validator <string> validator         = new FileExistsValidator();
            ValidationResults  validationResults = validator.Validate(null);

            Assert.IsFalse(validationResults.IsValid);
        }
예제 #7
0
        public bool[] GetMissingLibraries()
        {
            string[]    libraries = GetSupportingLibraries();
            List <bool> missing   = new List <bool>(libraries.Length);

            foreach (string file in libraries)
            {
                if (string.IsNullOrEmpty(SupportLibrariesPath))
                {
                    missing.Add(true);
                }
                else
                {
                    FileExistsValidator fileValidator =
                        new FileExistsValidator(SupportLibrariesPath);
                    bool fileExists = fileValidator.Validate(file).IsValid;
                    missing.Add(!fileExists);
                }
            }
            return(missing.ToArray());
        }
 public bool[] GetMissingLibraries()
 {
     string[] libraries = GetSupportingLibraries();
     List<bool> missing = new List<bool>(libraries.Length);
     foreach (string file in libraries)
     {
         if (string.IsNullOrEmpty(SupportLibrariesPath))
         {
             missing.Add(true);
         }
         else
         {
             FileExistsValidator fileValidator =
                 new FileExistsValidator(SupportLibrariesPath);
             bool fileExists = fileValidator.Validate(file).IsValid;
             missing.Add(!fileExists);
         }
     }
     return missing.ToArray();
 }