Example #1
0
        public void Setup()
        {
            _localAppDataFolder = $"{_localDataFolder}DWGitsh";

            _fileManager      = Substitute.For <IFile>();
            _diskManager      = Substitute.For <IStaticAbstraction>();
            _diskManager.File = _fileManager;
            _diskManager.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData).Returns(_localDataFolder);
            _diskManager.Path.Combine(_localDataFolder, "DWGitsh").Returns(_localAppDataFolder);
            _diskManager.Directory.Exists(_localAppDataFolder).Returns(true);

            _diskManager.NewDirectoryInfo(_localAppDataFolder).Returns(new MockDirectoryInfo {
                FullName = _localAppDataFolder, Name = "DWGitsh"
            });

            _config = Substitute.For <IDWGitshConfig>();
            _config.AppDataFolder.Returns(_localAppDataFolder);

            _repoPaths = Substitute.For <IRepositoryPaths>();
            _repoPaths.RootFolder.Returns("C:\\Junk\\Folder\\");
            _repoPaths.RepositoryFolder.Returns("C:\\Junk\\Folder\\.git\\");

            _hitRepo = Substitute.For <IHitDataRepo>();
            _manager = new HitDataManager(_config, _diskManager, _repoPaths, null, _hitRepo);

            _hitRepo.Load().Returns(new CommandData());
        }
Example #2
0
        public HitDataManager(IDWGitshConfig config, IStaticAbstraction diskManager, IRepositoryPaths repoDirs, IGitUtils utils = null, IHitDataRepo hitRepo = null)
        {
            _utils                     = utils ?? GitUtils.Current;
            this._diskManager          = diskManager ?? new StAbWrapper();
            this.RepositoryDirectories = repoDirs;

            _hitDataRepo = hitRepo ?? new HitDataRepo(config.AppDataFolder, _diskManager);
        }
Example #3
0
        public DWGitshCommonArgs(IStaticAbstraction diskManager, IDWGitshConfig config, IRepositoryPaths repoPaths, IGitUtils utils, ICacheContainer cache)
        {
            this.DiskManager = diskManager ?? new StAbWrapper();

            this.Config = config ?? new DWGitshConfig(DiskManager);

            this.Cache = cache ?? new CacheContainer(DiskManager);

            this.Utils = utils ?? new GitUtils(DiskManager, Cache);

            this.RepoPaths = repoPaths;
        }
Example #4
0
        public void Setup()
        {
            _hitManager  = Substitute.For <IHitDataManager>();
            _options     = Substitute.For <IGitChangeDirectoryOptions>();
            _diskManager = Substitute.For <IStaticAbstraction>();
            _repoPaths   = Substitute.For <IRepositoryPaths>();
            _config      = Substitute.For <IDWGitshConfig>();

            _args = Substitute.For <IDWGitshCommonArgs>();

            _args.DiskManager.Returns(_diskManager);
            _args.RepoPaths.Returns(_repoPaths);
            _args.Config.Returns(_config);
        }
Example #5
0
 public DWGitshCommonArgs(IStaticAbstraction diskManager, IDWGitshConfig config, IRepositoryPaths repoPaths, IGitUtils utils) : this(diskManager, config, repoPaths, utils, null)
 {
 }
Example #6
0
 public DWGitshCommonArgs(IStaticAbstraction diskManager, IDWGitshConfig config) : this(diskManager, config, null, null, null)
 {
 }
Example #7
0
 internal PowerShellCommandBase(IDWGitshCommonArgs commonArgs)
 {
     this._diskManager          = commonArgs.DiskManager;
     this._config               = commonArgs.Config;
     this.RepositoryDirectories = commonArgs.RepoPaths;
 }