public GithubController(
     IGithubService githubService,
     GithubSessionSettings githubSessionSettings,
     IMapper mapper)
 {
     _githubService         = githubService;
     _githubSessionSettings = githubSessionSettings;
     _mapper = mapper;
 }
 public HomeController(IHttpContextAccessor contextAccessor, ITrackerEntryService tableService, IGithubService githubService)
 {
     NullChecker.IsNotNull(contextAccessor, nameof(contextAccessor));
     NullChecker.IsNotNull(tableService, nameof(tableService));
     NullChecker.IsNotNull(githubService, nameof(githubService));
     _contextAccessor = contextAccessor;
     _tableService    = tableService;
     _githubService   = githubService;
 }
示例#3
0
        public RepositorySource(IGithubService service)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            this._service = service;
        }
        public GithubIncrementalItemSource(IGithubService service)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            this._service = service;
        }
示例#5
0
 public ItemDetailsViewModel(IAppNavigationService navigationService, IPageDialogService pageDialogService,
                             IDeviceService deviceService, IGithubService gitService)
     : base(navigationService, pageDialogService, deviceService)
 {
     GitHub    = gitService;
     Increment = 1;
     PageSize  = 50;
     Skip      = 0;
 }
示例#6
0
 public TabsPageVM(INavigationService navigationService,
                   IDialogService dialogService,
                   IGithubService githubService,
                   IBusStopRepository busStopRepository,
                   IAppUpdater appUpdater) : base(navigationService, dialogService)
 {
     _githubService     = githubService;
     _busStopRepository = busStopRepository;
     _locator           = CrossGeolocator.Current;
     _appUpdater        = appUpdater;
 }
示例#7
0
 public UserStatsController(ILogger <UserStatsController> logger,
                            IGithubService githubService,
                            IRankService rankService,
                            ISvgService svgService,
                            IWebHostEnvironment environment)
 {
     _logger        = logger;
     _githubService = githubService;
     _rankService   = rankService;
     _svgService    = svgService;
     _environment   = environment;
 }
 public DiscordBotHostedService(BaseSocketClient baseSocketClient,
                                IOptions <DiscordSettings> options,
                                IGithubService githubService,
                                ILogger <DiscordBotHostedService> logger,
                                IServiceScopeFactory serviceScopeFactory)
 {
     _client              = baseSocketClient;
     _discordSettings     = options.Value;
     _logger              = logger;
     _githubService       = githubService;
     _serviceScopeFactory = serviceScopeFactory;
 }
示例#9
0
 public Program(
     ILogger <Program> logger,
     IConsole console,
     IGithubService githubService,
     IChangelogParser changelogParser
     )
 {
     _logger          = logger;
     _console         = console;
     _githubService   = githubService;
     _changelogParser = changelogParser;
 }
 public AccountController(
     IUserRepository userRepository,
     IStudentRepository studentRepository,
     IJwtService jwtService,
     IGithubService githubService
     )
 {
     _userRepository    = userRepository;
     _studentRepository = studentRepository;
     _jwtService        = jwtService;
     _githubService     = githubService;
 }
        public HomeController(
            IGoogleService googleService,
            GoogleSessionSettings googleSessionSettings,
            IGithubService githubService,
            GithubSessionSettings githubSessionSettings)
        {
            _googleService         = googleService;
            _googleSessionSettings = googleSessionSettings;

            _githubService         = githubService;
            _githubSessionSettings = githubSessionSettings;
        }
        public DeveloperDomain(
            ILogger <DeveloperDomain> logger,
            IDeveloperRepository developerRepository,
            IGithubService githubService,
            IFeatureManager featureManager)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _developerRepository = developerRepository ?? throw new ArgumentNullException(nameof(developerRepository));
            _githubService       = githubService ?? throw new ArgumentNullException(nameof(githubService));

            _featureManager = featureManager ?? throw new ArgumentNullException(nameof(featureManager));
        }
 public DeveloperProfilesService(
     IDbRepository<DeveloperProfile, string> developerProfiles,
     IGithubService githubService,
     ISkillsService skills,
     IJobOffersService jobOffers,
     IUsersService users)
 {
     this.developerProfiles = developerProfiles;
     this.githubService = githubService;
     this.skills = skills;
     this.jobOffers = jobOffers;
     this.users = users;
 }
示例#14
0
 public NugetService(
     IFileSystem fileSystem,
     List <string> packageCachePaths,
     IGithubService githubService,
     HttpClient httpClient,
     string baseUrl = null)
 {
     _fileSystem        = fileSystem;
     _packageCachePaths = packageCachePaths;
     _githubService     = githubService;
     _httpClient        = httpClient;
     _baseUrl           = baseUrl == null ? "https://api.nuget.org/v3-flatcontainer/" : baseUrl;
 }
 public StudentController(
     IStudentRepository studentRepository,
     IGithubService githubService,
     IClaimProvider claimProvider,
     IMessageRepository messageRepository,
     IHubContext <MessagesHub> messageHub
     )
 {
     _studentRepository = studentRepository;
     _githubService     = githubService;
     _claimProvider     = claimProvider;
     _messageRepository = messageRepository;
     _messageHub        = messageHub;
 }
示例#16
0
        public GithubServiceTests()
        {
            var config = new ConfigurationBuilder()
                         .AddUserSecrets(Assembly.Load(new AssemblyName("HacktoberfestProject.Web")))
                         .AddEnvironmentVariables()
                         .Build();

            var client        = new GitHubClient(new ProductHeaderValue("HacktoberfestProject"));
            var configuration = Options.Create(new GithubConfiguration {
                ClientId = config["GitHub:clientId"], ClientSecret = config["GitHub:clientSecret"]
            });

            _githubService = new GithubService(new Logger <GithubService>(new LoggerFactory()), configuration, client);
        }
 public ManageController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IEmailSender emailSender,
     ILogger <ManageController> logger,
     UrlEncoder urlEncoder, IGithubService githubService, IUserStore <ApplicationUser> userStore)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _emailSender   = emailSender;
     _logger        = logger;
     _urlEncoder    = urlEncoder;
     _githubService = githubService;
     _userStore     = userStore;
 }
        public TwitterBotHostedService(ILogger <TwitterBotHostedService> logger,
                                       IEnumerable <IGrammarService> grammarServices,
                                       ITwitterLogService twitterLogService,
                                       ITwitterClient userClient,
                                       IOptions <TwitterBotSettings> options,
                                       IGithubService githubService,
                                       IScheduledTweetService scheduledTweetService,
                                       ISentimentAnalysisService sentimentAnalysisService)
            : base(logger, twitterLogService, userClient, options.Value, scheduledTweetService, sentimentAnalysisService)
        {
            _githubService = githubService;

            _grammarService = grammarServices.First(v => v.GrammarAlgorith == Defaults.DefaultAlgorithm);
            _grammarService.SetStrictnessLevel(CorrectionStrictnessLevels.Tolerant);
        }
示例#19
0
 public MainWindowViewModel(
     ILogger logger,
     IExtendedDialogService dialogService,
     IApiService apiService,
     IGithubService githubService,
     ICredentialService credentialService,
     IStreamlinkLauncher streamlinkLauncher,
     LibVLC libVLC)
 {
     _logger             = logger;
     _dialogService      = dialogService;
     _apiService         = apiService;
     _githubService      = githubService;
     _credentialService  = credentialService;
     _streamlinkLauncher = streamlinkLauncher;
     _libVLC             = libVLC;
 }
        public NugetV3Service(
            NugetInputModel nugetInput,
            IFileSystem fileSystem,
            List <string> packageCachePaths,
            IGithubService githubService,
            ILogger logger,
            bool disableHashComputation
            )
        {
            _fileSystem             = fileSystem;
            _packageCachePaths      = packageCachePaths;
            _githubService          = githubService;
            _disableHashComputation = disableHashComputation;
            _logger = logger;

            _sourceRepository   = SetupNugetRepository(nugetInput);
            _sourceCacheContext = new SourceCacheContext();
            _cancellationToken  = CancellationToken.None;
        }
示例#21
0
 public MainWindowViewModel(
     ILogger logger,
     IExtendedDialogService dialogService,
     IApiService apiService,
     IGithubService githubService,
     ICredentialService credentialService,
     IStreamlinkLauncher streamlinkLauncher,
     ISettings settings,
     IVideoDialogLayout videoDialogLayout)
     : base(logger)
 {
     _dialogService      = dialogService;
     _apiService         = apiService;
     _githubService      = githubService;
     _credentialService  = credentialService;
     _streamlinkLauncher = streamlinkLauncher;
     Settings            = settings;
     VideoDialogLayout   = videoDialogLayout;
 }
示例#22
0
 public MainWindowViewModel(
     ILogger logger,
     IExtendedDialogService dialogService,
     IApiService apiService,
     IGithubService githubService,
     ICredentialService credentialService,
     IStreamlinkLauncher streamlinkLauncher,
     ISettings settings,
     IVideoDialogLayout videoDialogLayout)
     : base(logger)
 {
     _dialogService      = dialogService;
     _apiService         = apiService;
     _githubService      = githubService;
     _credentialService  = credentialService;
     _streamlinkLauncher = streamlinkLauncher;
     Settings            = settings;
     VideoDialogLayout   = videoDialogLayout;
     EpisodesView        = CollectionViewSource.GetDefaultView(Episodes);
     EpisodesView.Filter = (episode) => string.IsNullOrEmpty(EpisodeFilterText) || episode.ToString().Contains(EpisodeFilterText, StringComparison.OrdinalIgnoreCase);
 }
示例#23
0
        public ServiceTests()
        {
            //Configure db
            var optionsBuilder =
                new DbContextOptionsBuilder <GithubReposContext>()
                .UseInMemoryDatabase("githubReposTestDB");
            var _dbContext = new GithubReposContext(optionsBuilder.Options);

            //Mock octokit
            ReadOnlyCollection <Repository> mockedRepos = new ReadOnlyCollection <Repository>(GetRepos());
            var response = new SearchRepositoryResult(ListSize, false, mockedRepos);

            var mockedClient = new Mock <IGitHubClient>();

            mockedClient.Setup(githubService =>
                               githubService.Search.SearchRepo(It.IsAny <SearchRepositoriesRequest>()))
            .Returns(Task.Factory.StartNew(() => response));

            //Mount service
            _service = new GithubService(_dbContext, mockedClient.Object);
        }
示例#24
0
 // TODO: With a bit more time i should have implemented the dependency injection
 // to pass the service to the controller
 public HomeController()
 {
     _githubservice = new GithubService();
 }
示例#25
0
 public ProjectService(DatabaseContext databaseContext, IGithubService githubService)
 {
     _dbContext     = databaseContext;
     _githubService = githubService;
 }
示例#26
0
 public MainViewModel(IGithubService service)
 {
     _repositoriesSource = new GithubIncrementalItemSource(service);
     Repositories        = new IncrementalLoadingCollection <Repository, GithubIncrementalItemSource>(_repositoriesSource);
 }
示例#27
0
 public NugetService(HttpClient httpClient, IGithubService githubService, string baseUrl = null)
 {
     _httpClient    = httpClient;
     _baseUrl       = baseUrl == null ? "https://api.nuget.org/v3-flatcontainer/" : baseUrl;
     _githubService = githubService;
 }
 public async Task <ActionResult <List <GithubRepository> > > GetOrganizationRepositories([FromServices] IGithubService githubRepository, string OrganizationName = "ibm")
 {
     if (!await isMemoryCachingEnabledAsync())
     {
         cache.Remove(OrganizationName);
     }
     return(await cache.GetOrCreateAsync(OrganizationName, RepositoryList =>
     {
         RepositoryList.SlidingExpiration = TimeSpan.FromSeconds(getCacheExpirationDuration());
         return githubRepository.getOrganizationRepositories(OrganizationName);
     }));
 }
示例#29
0
        public HomeController(GithubReposContext context)
        {
            var githubClient = new GitHubClient(new ProductHeaderValue(Environment.GetEnvironmentVariable("API_ID")));

            _service = new GithubService(context, githubClient);
        }
示例#30
0
 public GithubController(IGithubService githubService)
 {
     _githubService = githubService;
 }
示例#31
0
 public GitHubController(ILogger <GitHubController> logger, IGithubService gitHubService)
 {
     _logger        = logger;
     _gitHubService = gitHubService;
 }
示例#32
0
 private static void IsCorrectLoginToken(IGithubService service, string login, string token)
 {
     Assert.That(service.Client.LoginInfo["login"] == login);
     Assert.That(service.Client.LoginInfo["token"] == token);
 }
示例#33
0
 public MainViewModel(IGithubService service)
 {
     _repositoriesSource = new GithubIncrementalItemSource(service);
     Repositories = new IncrementalLoadingCollection<Repository, GithubIncrementalItemSource>(_repositoriesSource);
 }