public ICondition WasCreated() { return(new DelegatingCondition(() => { bool fileExists = fs.FileExists(folderName); if (!fileExists) { return EvaluationResult.Error(FolderMessages.NotCreated(folderName)); } return EvaluationResult.OK; })); }
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; })); }
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)); } })); }