public CommandDiscovery(ICommandFactory factory, IFileFactoryForPath fileFactory, IFolderFactoryForPath folderFactory) { _factory = factory; _fileFactory = fileFactory; _folderFactory = folderFactory; }
public static IFolderFactoryForPath GetFolderFactoryThatReturnsExistsFor(String folderToReturnTrueFor) { IFolderFactoryForPath folderFactory = (f) => { var folderToReturn = new FakeFolder(f); folderToReturn.FolderExistsReturnValue = f.Equals(folderToReturnTrueFor); return(folderToReturn); }; return(folderFactory); }
public void GetCommandListTask_TargetDoesNotExistSourceIsFile_FileLinkCreated() { String nonExistentPath = "testFile"; String targetPath = "target"; IFileFactoryForPath fileFactory = GetFileFactoryThatReturnsExistsFor(targetPath); IFolderFactoryForPath folderFactory = (s) => new FakeFolder(s); var factory = MockRepository.GenerateMock <ICommandFactory>(); var commandDiscovery = new CommandDiscovery(factory, fileFactory, folderFactory); commandDiscovery.GetCommandListTask(nonExistentPath, targetPath, false, false); factory.AssertWasCalled(f => f.CreateFileLinkCommand(Arg <IFile> .Matches(file => file.FullFilePath.Equals(nonExistentPath)), Arg <IFile> .Matches(file => file.FullFilePath.Equals(targetPath)))); }
private LinkerService GetLinkerService(ICommandDiscovery commandDiscovery, ITransactionalCommandRunner runner, IFolderFactoryForPath folderFactory) { return(new LinkerService(commandDiscovery, runner, (d, fd) => MockRepository.GenerateStub <IMessenger>())); }
public PathValidation(IFolderFactoryForPath folderFactory, IOperatingSystemVersion operatingSystemVersion) { _folderFactory = folderFactory; _operatingSystemVersion = operatingSystemVersion; }
public FolderImp(IFileFactoryForPath fileFactory, IFolderFactoryForPath folderFactory, String path) { FolderPath = path; FileFactoryForFile = fileFactory; FolderFactoryForPath = folderFactory; }
public OperationValidation(IFileFactoryForPath fileFactory, IFolderFactoryForPath folderFactory) { _folderFactory = folderFactory; _fileFactory = fileFactory; }
private LinkerService GetLinkerService(ICommandDiscovery commandDiscovery, ITransactionalCommandRunner runner, IFolderFactoryForPath folderFactory) { return new LinkerService(commandDiscovery, runner, (d, fd) => MockRepository.GenerateStub<IMessenger>()); }