public void FailsWhenIgnoreDirectoriesIsTrueWithDirectoryInfo()
        {
            var constraint = new FileOrDirectoryExistsConstraint().IgnoreDirectories;
            var ex         = Assert.Throws <ArgumentException>(() => constraint.ApplyTo(_goodDir.Directory));

            Assert.That(ex.Message, Does.StartWith("The actual value must be a string or FileInfo"));
        }
 public void FailsWhenIgnoreFilesIsTrueWithFileString()
 {
     using (new TestFile(TEST_FILE, RESOURCE_FILE))
     {
         var constraint = new FileOrDirectoryExistsConstraint().IgnoreFiles;
         Assert.That(constraint.ApplyTo(TEST_FILE).Status == ConstraintStatus.Failure);
     }
 }
 public void FailsWhenIgnoreFilesIsTrueWithFileInfo()
 {
     using (new TestFile(TEST_FILE, RESOURCE_FILE))
     {
         var constraint = new FileOrDirectoryExistsConstraint().IgnoreFiles;
         var ex         = Assert.Throws <ArgumentException>(() => constraint.ApplyTo(new FileInfo(TEST_FILE)));
         Assert.That(ex.Message, Does.StartWith("The actual value must be a string or DirectoryInfo"));
     }
 }
 public void SetUp()
 {
     _constraint = new FileOrDirectoryExistsConstraint();
     _goodDir    = new TestDirectory();
     Assume.That(BAD_DIRECTORY, Does.Not.Exist, BAD_DIRECTORY + " exists");
 }
        public void FailsWhenIgnoreDirectoriesIsTrueWithDirectoryString()
        {
            var constraint = new FileOrDirectoryExistsConstraint().IgnoreDirectories;

            Assert.That(constraint.ApplyTo(_goodDir.ToString()).Status == ConstraintStatus.Failure);
        }
 public void FailsWhenIgnoreFilesIsTrueWithFileString()
 {
     using (var tf = new TestFile(TEST_FILE, RESOURCE_FILE))
     {
         var constraint = new FileOrDirectoryExistsConstraint().IgnoreFiles;
         Assert.That(constraint.ApplyTo(tf.File.FullName).Status == ConstraintStatus.Failure);
     }
 }
 public void SetUp()
 {
     _constraint = new FileOrDirectoryExistsConstraint();
     _goodDir = new TestDirectory();
     Assume.That(BAD_DIRECTORY, Does.Not.Exist, BAD_DIRECTORY + " exists");
 }
 public void FailsWhenIgnoreDirectoriesIsTrueWithDirectoryInfo()
 {
     var constraint = new FileOrDirectoryExistsConstraint().IgnoreDirectories;
     var ex = Assert.Throws<ArgumentException>(() => constraint.ApplyTo(_goodDir.Directory));
     Assert.That(ex.Message, Does.StartWith("The actual value must be a string or FileInfo"));
 }
 public void FailsWhenIgnoreDirectoriesIsTrueWithDirectoryString()
 {
     var constraint = new FileOrDirectoryExistsConstraint().IgnoreDirectories;
     Assert.That(constraint.ApplyTo(_goodDir.ToString()).Status == ConstraintStatus.Failure);
 }
 public void FailsWhenIgnoreFilesIsTrueWithFileInfo()
 {
     using (var tf = new TestFile(TEST_FILE, RESOURCE_FILE))
     {
         var constraint = new FileOrDirectoryExistsConstraint().IgnoreFiles;
         var ex = Assert.Throws<ArgumentException>(() => constraint.ApplyTo(tf.File));
         Assert.That(ex.Message, Does.StartWith("The actual value must be a string or DirectoryInfo"));
     }
 }