Пример #1
0
 /// <inheritdoc />
 public DtoController(IGetService <Dto> getService,
                      ICreateService <Dto, DtoCreate> createService,
                      IUpdateService <Dto, DtoUpdate> updateService,
                      IPatchService <Dto, DtoUpdate> patchService,
                      IDeleteService <Dto> deleteService) : base(getService, createService, updateService, patchService, deleteService)
 {
 }
Пример #2
0
 public DiffContentFetcher(PullRequestLocator pullRequestLocator,
                           IFileContentPersist fileContentPersist, IGitHubClient client, IPatchService patchService)
 {
     _pullRequestLocator = pullRequestLocator;
     _fileContentPersist = fileContentPersist;
     _client             = client;
     _patchService       = patchService;
 }
Пример #3
0
 public DiffContentFetcher(PullRequestLocator pullRequestLocator,
                           IFileContentPersist fileContentPersist,
                           IPatchService patchService, IFileContentRetriever fileContentRetriever)
 {
     _pullRequestLocator   = pullRequestLocator;
     _fileContentPersist   = fileContentPersist;
     _patchService         = patchService;
     _fileContentRetriever = fileContentRetriever;
 }
 protected WriteController(IGetService <TModel> getService,
                           ICreateService <TModel, TCreateModel> createService,
                           IUpdateService <TModel, TUpdateModel> updateService,
                           IPatchService <TModel, TUpdateModel> patchService,
                           IDeleteService <TModel> deleteService) : base(getService)
 {
     CreateService = createService;
     UpdateService = updateService;
     PatchService  = patchService;
     DeleteService = deleteService;
 }
Пример #5
0
 /// <summary>
 /// For testing purposes only.
 /// </summary>
 internal SymbolSearchUpdateEngine(
     ISymbolSearchLogService logService,
     IRemoteControlService remoteControlService,
     IDelayService delayService,
     IIOService ioService,
     IPatchService patchService,
     IDatabaseFactoryService databaseFactoryService,
     Func <Exception, bool> reportAndSwallowException)
 {
     _delayService              = delayService;
     _ioService                 = ioService;
     _logService                = logService;
     _remoteControlService      = remoteControlService;
     _patchService              = patchService;
     _databaseFactoryService    = databaseFactoryService;
     _reportAndSwallowException = reportAndSwallowException;
 }
Пример #6
0
        /// <summary>
        /// For testing purposes only.
        /// </summary>
        internal SymbolSearchUpdateEngine(
            ISymbolSearchLogService logService,
            IRemoteControlService remoteControlService,
            IDelayService delayService,
            IIOService ioService,
            IPatchService patchService,
            IDatabaseFactoryService databaseFactoryService,
            Func<Exception, bool> reportAndSwallowException,
            CancellationToken updateCancellationToken)
        {
            _delayService = delayService;
            _ioService = ioService;
            _logService = logService;
            _remoteControlService = remoteControlService;
            _patchService = patchService;
            _databaseFactoryService = databaseFactoryService;
            _reportAndSwallowException = reportAndSwallowException;

            _updateCancellationToken = updateCancellationToken;
        }
Пример #7
0
 public MainWindowVm(IGitHubClient client, IFileContentPersist fileContentPersist,
                     IDiffToolLauncher diffTool,
                     IPatchService patchService,
                     ICommentsBuilder commentsBuilder,
                     ICommentsPersist commentsPersist,
                     IRepoHistoryPersist repoHistoryPersist,
                     IBackgroundTaskRunner backgroundTaskRunner, IUserManager userManager)
 {
     Diffs                 = new ObservableCollection <CommitFileVm>();
     Commits               = new ObservableCollection <CommitVm>();
     _client               = client;
     PersonalToken         = userManager.CurrentUser.Token;
     _fileContentPersist   = fileContentPersist;
     _diffTool             = diffTool;
     _patchService         = patchService;
     _reviewClient         = client.Issue.Comment;
     _commentsBuilder      = commentsBuilder;
     _commentsPersist      = commentsPersist;
     _repoHistoryPersist   = repoHistoryPersist;
     _backgroundTaskRunner = backgroundTaskRunner;
 }
Пример #8
0
 public AsyncFhirService(
     IResourceStorageService storageService,
     IPagingService pagingService,
     ISearchService searchService,
     ITransactionService transactionService,
     ICapabilityStatementService capabilityStatementService,
     IHistoryStore historyService,
     IFhirResponseFactory responseFactory,
     ICompositeServiceListener serviceListener,
     IPatchService patchService)
 {
     _storageService             = storageService;
     _pagingService              = pagingService;
     _searchService              = searchService;
     _transactionService         = transactionService;
     _capabilityStatementService = capabilityStatementService;
     _historyService             = historyService;
     _responseFactory            = responseFactory;
     _serviceListener            = serviceListener;
     _patchService = patchService;
 }
Пример #9
0
 public MainViewModel()
 {
     Services      = ConfigureServices();
     logger        = Services.GetRequiredService <ILoggerService>();
     mainThread    = Services.GetRequiredService <IMainThreadService>();
     memory        = Services.GetRequiredService <IMemoryService>();
     navigation    = Services.GetRequiredService <INavigationService>();
     objectManager = Services.GetRequiredService <IObjectManagerService>();
     endScene      = Services.GetRequiredService <IEndSceneService>();
     patch         = Services.GetRequiredService <IPatchService>();
     ReloadBasesAsync();
     ReloadBasesAsyncCommand = new AsyncCommand(ReloadBasesAsync);
     StartBaseAsyncCommand   = new AsyncCommand(StartBaseAsync, CanStartBase);
     StopBaseAsyncCommand    = new AsyncCommand(StopBaseAsync, CanStopBase);
     ToggleGUIAsyncCommand   = new AsyncCommand(ToggleGUIAsync);
     AsyncCommands           = new IAsyncCommand[]
     {
         ReloadBasesAsyncCommand,
         StartBaseAsyncCommand,
         StopBaseAsyncCommand,
         ToggleGUIAsyncCommand
     };
 }
Пример #10
0
        /// <summary>
        /// For testing purposes only.
        /// </summary>
        internal SymbolSearchService(
            Workspace workspace,
            IPackageInstallerService installerService,
            IRemoteControlService remoteControlService,
            ILogService logService,
            IDelayService delayService,
            IIOService ioService,
            IPatchService patchService,
            IDatabaseFactoryService databaseFactoryService,
            string localSettingsDirectory,
            Func <Exception, bool> reportAndSwallowException,
            CancellationTokenSource cancellationTokenSource)
        {
            if (remoteControlService == null)
            {
                // If we can't access the file update service, then there's nothing we can do.
                return;
            }

            _workspace                 = workspace;
            _installerService          = installerService;
            _delayService              = delayService;
            _ioService                 = ioService;
            _logService                = logService;
            _remoteControlService      = remoteControlService;
            _patchService              = patchService;
            _databaseFactoryService    = databaseFactoryService;
            _reportAndSwallowException = reportAndSwallowException;

            _cacheDirectoryInfo = new DirectoryInfo(Path.Combine(
                                                        localSettingsDirectory, "PackageCache", string.Format(Invariant($"Format{_dataFormatVersion}"))));
            // _databaseFileInfo = new FileInfo(Path.Combine(_cacheDirectoryInfo.FullName, "NuGetCache.txt"));

            _cancellationTokenSource = cancellationTokenSource;
            _cancellationToken       = _cancellationTokenSource.Token;
        }
Пример #11
0
        /// <summary>
        /// For testing purposes only.
        /// </summary>
        internal SymbolSearchService(
            Workspace workspace,
            IPackageInstallerService installerService,
            IRemoteControlService remoteControlService,
            ILogService logService,
            IDelayService delayService,
            IIOService ioService,
            IPatchService patchService,
            IDatabaseFactoryService databaseFactoryService,
            string localSettingsDirectory,
            Func<Exception, bool> reportAndSwallowException,
            CancellationTokenSource cancellationTokenSource) 
            : base(workspace, ServiceComponentOnOffOptions.SymbolSearch,
                              AddImportOptions.SuggestForTypesInReferenceAssemblies,
                              AddImportOptions.SuggestForTypesInNuGetPackages)
        {
            if (remoteControlService == null)
            {
                // If we can't access the file update service, then there's nothing we can do.
                return;
            }

            _workspace = workspace;
            _installerService = installerService;
            _delayService = delayService;
            _ioService = ioService;
            _logService = logService;
            _remoteControlService = remoteControlService;
            _patchService = patchService;
            _databaseFactoryService = databaseFactoryService;
            _localSettingsDirectory = localSettingsDirectory;
            _reportAndSwallowException = reportAndSwallowException;

            _cancellationTokenSource = cancellationTokenSource;
            _cancellationToken = _cancellationTokenSource.Token;
        }
Пример #12
0
        /// <summary>
        /// For testing purposes only.
        /// </summary>
        internal SymbolSearchService(
            Workspace workspace,
            IPackageInstallerService installerService,
            IRemoteControlService remoteControlService,
            ILogService logService,
            IDelayService delayService,
            IIOService ioService,
            IPatchService patchService,
            IDatabaseFactoryService databaseFactoryService,
            string localSettingsDirectory,
            Func <Exception, bool> reportAndSwallowException,
            CancellationTokenSource cancellationTokenSource)
            : base(workspace, ServiceComponentOnOffOptions.SymbolSearch,
                   AddImportOptions.SuggestForTypesInReferenceAssemblies,
                   AddImportOptions.SuggestForTypesInNuGetPackages)
        {
            if (remoteControlService == null)
            {
                // If we can't access the file update service, then there's nothing we can do.
                return;
            }

            _workspace                 = workspace;
            _installerService          = installerService;
            _delayService              = delayService;
            _ioService                 = ioService;
            _logService                = logService;
            _remoteControlService      = remoteControlService;
            _patchService              = patchService;
            _databaseFactoryService    = databaseFactoryService;
            _localSettingsDirectory    = localSettingsDirectory;
            _reportAndSwallowException = reportAndSwallowException;

            _cancellationTokenSource = cancellationTokenSource;
            _cancellationToken       = _cancellationTokenSource.Token;
        }
Пример #13
0
        public void SetUp()
        {
            _compareResults       = new MockCompareResult();
            _gitHubClient         = Substitute.For <IGitHubClient>();
            _repoClient           = Substitute.For <IRepositoriesClient>();
            _commitsClient        = Substitute.For <IRepositoryCommitsClient>();
            _prClient             = Substitute.For <IPullRequestsClient>();
            _contentsClient       = Substitute.For <IRepositoryContentsClient>();
            _fileContentPersist   = Substitute.For <IFileContentPersist>();
            _diffTool             = Substitute.For <IDiffToolLauncher>();
            _patchService         = Substitute.For <IPatchService>();
            _reviewClient         = Substitute.For <IIssueCommentsClient>();
            _commentsBuilder      = Substitute.For <ICommentsBuilder>();
            _commentsPersist      = Substitute.For <ICommentsPersist>();
            _repoHistoryPersist   = Substitute.For <IRepoHistoryPersist>();
            _backgroundTaskRunner = Substitute.For <IBackgroundTaskRunner>();
            var userManager = Substitute.For <IUserManager>();

            _gitHubClient.Repository.Returns(_repoClient);
            _repoClient.Commit.Returns(_commitsClient);
            _repoClient.PullRequest.Returns(_prClient);
            _repoClient.Content.Returns(_contentsClient);
            _gitHubClient.Issue.Comment.Returns(_reviewClient);

            _commitsClient.Compare(Arg.Any <string>(),
                                   Arg.Any <string>(),
                                   Arg.Any <string>(),
                                   Arg.Any <string>()
                                   ).Returns(Task.FromResult((CompareResult)_compareResults));

            _mainWindowVm = new MainWindowVm(_gitHubClient, _fileContentPersist,
                                             _diffTool, _patchService, _commentsBuilder,
                                             _commentsPersist, _repoHistoryPersist, _backgroundTaskRunner, userManager)
            {
                PullRequestLocator = _pullRequestLocator,
                IsUrlMode          = false
            };

            _pullRequest = new MockPullRequest {
                Number = _pullRequestLocator.PullRequestNumber
            };
            _prClient.Get(_mainWindowVm.PullRequestLocator.Owner, _mainWindowVm.PullRequestLocator.Repository,
                          _mainWindowVm.PullRequestLocator.PullRequestNumber).Returns(Task.FromResult((PullRequest)_pullRequest));

            _baseFileName = MainWindowVm.BuildBaseFileName(_pullRequest.Base.Sha, _compareResults.File1.Filename);
            _headFileName = MainWindowVm.BuildHeadFileName(_pullRequest.Head.Sha, _compareResults.File1.Filename);

            _commentsContainer = new CommentsContainer {
                GeneralComments = GeneralComments
            };
            _commentsContainer.FileComments.Add(new FileComment
            {
                FileName     = _compareResults.File1.Filename,
                Comments     = Comment1,
                ReviewStatus = ReviewStatus1
            });
            _commentsContainer.FileComments.Add(new FileComment
            {
                FileName     = _compareResults.File2.Filename,
                Comments     = Comment2,
                ReviewStatus = ReviewStatus2
            });
            _commentsPersist.Load(Arg.Is <PullRequestLocator>(x => x.Equals(_pullRequestLocator)))
            .Returns(Task.FromResult(_commentsContainer));

            _backgroundTaskRunner.WhenForAnyArgs(x => x.RunInBackground(null)).Do(args =>
            {
                var a = args[0] as Action;
                a.Invoke();
            });

            _commentsPersist.ClearReceivedCalls();
            _backgroundTaskRunner.ClearReceivedCalls();
        }
Пример #14
0
 /// <summary>
 /// Create new DI object operation
 /// </summary>
 public DiffObjectOperation(IPatchService patchService)
 {
     this.m_patchService = patchService;
 }