public AudioLocalRepositoryBuilder() { _pathWrapper = Substitute.For<IPathWrapper>(); _streamFactory = Substitute.For<IFileStreamFactory>(); _directoryWrapper = Substitute.For<IDirectoryWrapper>(); _fileWrapper = Substitute.For<IFileWrapper>(); }
public LocalPathProvider( string appEnvironmentPath, IPathWrapper pathWrapper, IGuidWrapper guidWrapper) { _guidWrapper = guidWrapper; _pathWrapper = pathWrapper; _appEnvironmentPath = appEnvironmentPath; }
public BuildScriptLocator( IFileWrapper file, IPathWrapper path, ILogger <BuildScriptLocator> log) { _file = file; _path = path; _log = log; }
public ConfigLoader(IConfigurationService configurationService, IConfigDebinarizer configDebinarizer, IPathWrapper pathWrapper, IFileWrapper fileWrapper) { _configurationService = configurationService; _configDebinarizer = configDebinarizer; _pathWrapper = pathWrapper; _fileWrapper = fileWrapper; }
public AudioLocalRepositoryImpl( IPathWrapper pathWrapper, IDirectoryWrapper directoryWrapper, IFileStreamFactory streamFactory, IFileWrapper fileWrapper) { _directoryWrapper = directoryWrapper; _streamFactory = streamFactory; _fileWrapper = fileWrapper; _pathWrapper = pathWrapper; }
public CommandExecutor( CommandArguments args, IScriptLoader scriptLoader, ITaskSession taskSession, IFileWrapper file, IPathWrapper path, ILogger <CommandExecutor> log) { _args = args; _scriptLoader = scriptLoader; _taskSession = taskSession; _file = file; _path = path; _log = log; }
public FileManagerTests() { _environment = A.Fake <IHostingEnvironment>(); _formFile = A.Fake <IFormFile>(); _fileSystem = A.Fake <IFileSystemWrapper>(); _pathWrapper = A.Fake <IPathWrapper>(); _fileWrapper = A.Fake <IFileWrapper>(); _directoryWrapper = A.Fake <IDirectoryWrapper>(); A.CallTo(() => _fileSystem.File).Returns(_fileWrapper); A.CallTo(() => _fileSystem.Directory).Returns(_directoryWrapper); A.CallTo(() => _fileSystem.Path).Returns(_pathWrapper); sut = new FileManager(_environment, _fileSystem); }
public void BackupDatabase(IWrapperProvider wrapperProvider, string path) { IPathWrapper pathWrapper = wrapperProvider.GetWrapper <IPathWrapper>(); IDirectoryWrapper directoryWrapper = wrapperProvider.GetWrapper <IDirectoryWrapper>(); IFileWrapper fileWrapper = wrapperProvider.GetWrapper <IFileWrapper>(); //copy data.xml to data.xml.bak //copy data.xml to data_date.bak - it will override last dayily backup. first run of day will create new one string backupFileName = pathWrapper.GetFileNameWithoutExtension(path) + DateTime.Now.ToString("yyyyMMdd"); string backupPath = pathWrapper.Combine( pathWrapper.GetDirectoryName(path), backupFileName); backupPath = pathWrapper.ChangeExtension(backupPath, pathWrapper.GetExtension(path)); bool backupExists = File.Exists(backupPath); File.Copy(path, backupPath, true); if (!backupExists) { ManageBackups(path, pathWrapper, directoryWrapper, fileWrapper); } }
public void ManageBackups( string path, IPathWrapper pathWrapper, IDirectoryWrapper directoryWrapper, IFileWrapper fileWrapper) { string dataFileFilter = Path.ChangeExtension( string.Format("{0}*", Path.GetFileNameWithoutExtension(DataFile)), Path.GetExtension(DataFile)); var backupFiles = directoryWrapper.EnumerateFiles( pathWrapper.GetDirectoryName(path), dataFileFilter).Where(f => f != FullDataFilePath).OrderByDescending(f => f); //first save of day - delete old backups int backupcount = backupFiles.Count(); int skipfiles = 7; //backups to keep if (backupcount > skipfiles) { foreach (string s in backupFiles.Skip(skipfiles)) { fileWrapper.Delete(s); } } }
public ClassDirectiveProcessor(IFileWrapper file, IPathWrapper path) { _file = file; _path = path; }
public AudioLocalRepositoryBuilder WithPathWrapper(IPathWrapper pathWrapper) { _pathWrapper = pathWrapper; return this; }
public AttributesProcessor(IFileWrapper file, IPathWrapper pathWrapper, IDirectoryWrapper directory) { _file = file; _pathWrapper = pathWrapper; _directory = directory; }
public UpdateNetCoreVersionTask(IPathWrapper pathWrapper, IFileWrapper filWrapper, string file) { _file = filWrapper; _pathWrapper = pathWrapper; _files.Add(file); }
public AssemblyDirectiveProcessor(IFileWrapper file, IPathWrapper pathWrapper, ILogger <AssemblyDirectiveProcessor> log) { _log = log; _file = file; _pathWrapper = pathWrapper; }
public AssemblyDirectiveProcessor(IFileWrapper file, IPathWrapper pathWrapper) { _file = file; _pathWrapper = pathWrapper; }
public LocalPathProviderBuilder() { _pathMock = Substitute.For <IPathWrapper>(); _guidMock = Substitute.For <IGuidWrapper>(); _webRootPath = "testWebRoot"; }
public FileSystemWrapper(IFileWrapper file, IDirectoryWrapper directory, IPathWrapper path) { this.File = file; this.Directory = directory; this.Path = path; }