Пример #1
0
        public DevDfsTests()
        {
            _hashProvider = new HashProvider(HashingAlgorithm.GetAlgorithmMetadata("blake2b-256"));
            _fileSystem   = Substitute.For <IFileSystem>();
            var file = Substitute.For <IFile>();

            _fileSystem.File.Returns(file);
            _fileSystem.GetCatalystDataDir()
            .Returns(new DirectoryInfo("correct-information"));
            _dfs = new DevDfs(_fileSystem, _hashProvider);

            _baseFolder = Path.Combine(_fileSystem.GetCatalystDataDir().FullName,
                                       Constants.DfsDataSubDir);
        }
Пример #2
0
        public TestFileSystem(string rootPath)
        {
            var rootDirectory = new DirectoryInfo(rootPath);

            _fileSystem = Substitute.ForPartsOf <FileSystem>();
            _fileSystem.GetCatalystDataDir().Returns(rootDirectory);
            _retryPolicy = Policy.Handle <IOException>()
                           .WaitAndRetry(5, i => TimeSpan.FromMilliseconds(500).Multiply(i));
        }
Пример #3
0
 public DirectoryInfo GetCatalystDataDir()
 {
     return(_fileSystem.GetCatalystDataDir());
 }