예제 #1
0
 public ICondition WasCreated()
 {
     return(new DelegatingCondition(() => {
         bool fileExists = fs.FileExists(folderName);
         if (!fileExists)
         {
             return EvaluationResult.Error(FolderMessages.NotCreated(folderName));
         }
         return EvaluationResult.OK;
     }));
 }
예제 #2
0
 public ICondition DeletedCreated()
 {
     return(new DelegatingCondition(() => {
         var results = new MultiEvaluationResult();
         foreach (var name in names)
         {
             if (fileSystem.DirectoryExists(name))
             {
                 results.add(EvaluationResult.Error(FolderMessages.NotDeleted(name)));
             }
         }
         return results;
     }));
 }
예제 #3
0
        public ICondition WasRenamedTo(string newFolder)
        {
            return(new DelegatingCondition(() => {
                bool newExists = fs.FileExists(newFolder);
                bool oldExists = fs.FileExists(folderName);

                if (newExists && !oldExists)
                {
                    return EvaluationResult.OK;
                }
                else if (oldExists)
                {
                    return EvaluationResult.Error(FolderMessages.NotRenamedOldExists(folderName));
                }
                else
                {
                    return EvaluationResult.Error(FolderMessages.NotRenamedNewNotFound(newFolder));
                }
            }));
        }