Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DatasetSaver"/> class.
        /// </summary>
        /// <param name="dataRootConfig">Validated configuration of needed directories.</param>
        public DatasetSaver(DataRootConfig dataRootConfig)
        {
            _cacheRoot  = dataRootConfig.LocalPath;
            _remoteRoot = dataRootConfig.RemotePath;

            FileSystem = DependencyResolver.GetService <IFileSystem>();
        }
        public void DataRootReturnsInputValues()
        {
            var dataRootConfig = new DataRootConfig(goodLocalPath, goodRemotePath);

            Assert.AreEqual(expected: goodLocalPath, actual: dataRootConfig.LocalPath);
            Assert.AreEqual(expected: goodRemotePath, actual: dataRootConfig.RemotePath);
        }
        public void SetUp()
        {
            DependencyResolver.AddModule(new MockModule());

            var localDirFull   = Path.Combine(_rootDir, _cacheDir);
            var remoteDirFull  = Path.Combine(_rootDir, _remoteDir);
            var correctDataset = File.ReadAllText(Path.Combine(_fileDir, "small-test.txt"));

            _mockFileSystem = DependencyResolver.GetService <IFileSystem>() as MockFileSystem;
            _mockFileSystem.AddDirectory(localDirFull);
            _mockFileSystem.AddDirectory(remoteDirFull);
            _mockFileSystem.AddFile(Path.Combine(localDirFull, "local_correct.txt"), new MockFileData(correctDataset));

            _rootConfig   = new DataRootConfig(localDirFull, remoteDirFull);
            _datasetSaver = new DatasetSaver(_rootConfig);
        }