コード例 #1
0
 /// <summary>
 /// Construct a <see cref="PayloadProcessor"/>
 /// </summary>
 /// <param name="gitHubConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="gitHubConfiguration"/></param>
 /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/></param>
 /// <param name="generatorFactory">The value of <see cref="generatorFactory"/></param>
 /// <param name="serviceProvider">The value of <see cref="serviceProvider"/></param>
 /// <param name="repositoryManager">The value of <see cref="repositoryManager"/></param>
 /// <param name="ioManager">The value of <see cref="ioManager"/></param>
 /// <param name="logger">The value of <see cref="logger"/></param>
 /// <param name="stringLocalizer">The value of <see cref="stringLocalizer"/></param>
 /// <param name="backgroundJobClient">The value of <see cref="backgroundJobClient"/></param>
 public PayloadProcessor(IOptions <GitHubConfiguration> gitHubConfigurationOptions, IOptions <GeneralConfiguration> generalConfigurationOptions, IGeneratorFactory generatorFactory, IServiceProvider serviceProvider, ILocalRepositoryManager repositoryManager, IIOManager ioManager, ILogger <PayloadProcessor> logger, IStringLocalizer <PayloadProcessor> stringLocalizer, IBackgroundJobClient backgroundJobClient)
 {
     gitHubConfiguration      = gitHubConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(gitHubConfigurationOptions));
     generalConfiguration     = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions));
     this.ioManager           = new ResolvingIOManager(ioManager ?? throw new ArgumentNullException(nameof(ioManager)), WorkingDirectory);
     this.generatorFactory    = generatorFactory ?? throw new ArgumentNullException(nameof(generatorFactory));
     this.serviceProvider     = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     this.repositoryManager   = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager));
     this.logger              = logger ?? throw new ArgumentNullException(nameof(logger));
     this.stringLocalizer     = stringLocalizer ?? throw new ArgumentNullException(nameof(stringLocalizer));
     this.backgroundJobClient = backgroundJobClient ?? throw new ArgumentNullException(nameof(backgroundJobClient));
 }
コード例 #2
0
        public void Setup()
        {
            if (_referenceRepository is null)
            {
                _referenceRepository = new ReferenceRepository();
            }
            else
            {
                _referenceRepository.Reset();
            }

            _localRepositoryManager = Substitute.For <ILocalRepositoryManager>();
        }
コード例 #3
0
        public void Setup()
        {
            if (_referenceRepository == null)
            {
                _referenceRepository = new ReferenceRepository();
            }
            else
            {
                _referenceRepository.Reset();
            }

            _localRepositoryManager = Substitute.For <ILocalRepositoryManager>();
            _form = new FormOpenDirectory(null);
        }
コード例 #4
0
        private static GitModule OpenGitRepository([NotNull] string path, ILocalRepositoryManager localRepositoryManager)
        {
            if (!Directory.Exists(path))
            {
                return(null);
            }

            var chosenModule = new GitModule(path.EnsureTrailingPathSeparator());

            if (!chosenModule.IsValidGitWorkingDir())
            {
                return(null);
            }

            ThreadHelper.JoinableTaskFactory.Run(() => localRepositoryManager.AddAsMostRecentAsync(chosenModule.WorkingDir));
            return(chosenModule);
        }
コード例 #5
0
 public static GitModule?OpenGitRepository(string path, ILocalRepositoryManager localRepositoryManager)
 => FormOpenDirectory.OpenGitRepository(path, localRepositoryManager);
コード例 #6
0
 public GitModule OpenGitRepository([NotNull] string path, ILocalRepositoryManager localRepositoryManager) => FormOpenDirectory.OpenGitRepository(path, localRepositoryManager);