Ejemplo n.º 1
0
      public void ShouldAbortOnError_is_set_it_should_not_abort_when_no_error_found() {
         var dirDoesExist_valid = new ExistsTask(new DotNetPath(), "dummy", null, new List<string> { tempPath, dllPath }, null, null,
            true);
         var result = dirDoesExist_valid.Execute();

         result.ContainsError().ShouldBeFalse();
         result.ShouldAbort.ShouldBeFalse();
      }
Ejemplo n.º 2
0
      public void FilesShould_NOT_ExistTests() {
         //this exists
         var fileDoesExist = new ExistsTask(new DotNetPath(), "FilesShould_NOT_ExistTests", null, null, new List<string> { tempFile }, null);
         var result = fileDoesExist.Execute();
         result.ContainsError().ShouldBeTrue();

         //this does not. - result should contain errors!
         var fileDoesNotExist = new ExistsTask(new DotNetPath(), "FilesShould_NOT_ExistTests", null, null, new List<string> { tempFile + Guid.NewGuid() + ".thisShouldNotExist" }, null);
         var resultNotExists = fileDoesNotExist.Execute();
         resultNotExists.ContainsError().ShouldBeFalse();
      }
Ejemplo n.º 3
0
        public void DirectoryShould_NOT_ExistTests()
        {
            //these don't exist, a good thing now
             var dirDoesExist = new ExistsTask(new DotNetPath(), "DirectoryShould_NOT_ExistTests", null, null, null, new List<string> { tempPath + Guid.NewGuid(), dllPath + Guid.NewGuid() });
             var result = dirDoesExist.Execute();
             result.ContainsError().ShouldBeFalse();

             //this does not.
             var dirDoesNotExist = new ExistsTask(new DotNetPath(), "DirectoryShould_NOT_ExistTests", null, null, null, new List<string> { tempPath, dllPath });
             var resultNotExists = dirDoesNotExist.Execute();
             //should contain an error
             resultNotExists.ContainsError().ShouldBeTrue();
             //should be two Error results
             resultNotExists.ShouldContain(DeploymentItemStatus.Error, 2);
        }
Ejemplo n.º 4
0
        public void DirectoryShouldExistTests()
        {
            //this exists
             var dirDoesExist = new ExistsTask(new DotNetPath(), "DirectoryShouldExistTests", null, new List<string> { tempPath, dllPath }, null, null);
             var result = dirDoesExist.Execute();
             result.ContainsError().ShouldBeFalse();

             //this does not.
             var dirDoesNotExist = new ExistsTask(new DotNetPath(), "DirectoryShouldExistTests", null, new List<string> { tempPath + Guid.NewGuid() + ".thisShouldNotExist", tempPath + Guid.NewGuid() + ".thisShouldNotExistToo" }, null, null);
             var resultNotExists = dirDoesNotExist.Execute();
             //should contain an error
             resultNotExists.ContainsError().ShouldBeTrue();
             //should be two errors
             resultNotExists.ShouldContain(DeploymentItemStatus.Error, 2);
        }