private HttpClient GetTestClient(IDeploymentService deploymentService, IPipelineService pipelineService) { string unitTestFolder = Path.GetDirectoryName(new Uri(typeof(RepositoriesControllerTest).Assembly.Location).LocalPath); Program.ConfigureSetupLogging(); HttpClient client = _factory.WithWebHostBuilder(builder => { builder.ConfigureAppConfiguration((context, conf) => { conf.AddJsonFile("appsettings.json"); }); var configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.json") .Build(); builder.ConfigureTestServices(services => { services.AddSingleton <IGitea, IGiteaMock>(); services.AddSingleton(deploymentService); services.AddSingleton(pipelineService); }); }).CreateClient(new WebApplicationFactoryClientOptions { AllowAutoRedirect = false }); return(client); }
/// <summary> /// Constructor /// </summary> public PipelinesController( IPipelineService pipelineService, ILogger <PipelinesController> logger) { _pipelineService = pipelineService; _logger = logger; }
public ContractsController(IContractService IContractService, IPipelineService IPipelineService, ILocationService ILocationService, ImetadataRequestTypeService ImetadataRequestTypeService) : base(IPipelineService) { _IContractService = IContractService; //_IPipelineService = IPipelineService; _ILocationService = ILocationService; _ImetadataRequestTypeService = ImetadataRequestTypeService; }
private HttpClient GetTestClient(IReleaseService releasesService, IPipelineService pipelineService) { string unitTestFolder = Path.GetDirectoryName(new Uri(typeof(RepositoryControllerTests).Assembly.Location).LocalPath); string projectDir = Directory.GetCurrentDirectory(); string configPath = Path.Combine(projectDir, "appsettings.json"); HttpClient client = _factory.WithWebHostBuilder(builder => { builder.ConfigureAppConfiguration((context, conf) => { conf.AddJsonFile(configPath); }); var configuration = new ConfigurationBuilder() .AddJsonFile(configPath) .Build(); builder.ConfigureTestServices(services => { services.AddSingleton <IGitea, IGiteaMock>(); services.AddSingleton(releasesService); services.AddSingleton(pipelineService); }); }).CreateClient(new WebApplicationFactoryClientOptions { AllowAutoRedirect = false }); return(client); }
public virtual async void TestDelete() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; IPipelineService service = testServer.Host.Services.GetService(typeof(IPipelineService)) as IPipelineService; var model = new ApiPipelineServerRequestModel(); model.SetProperties(1, 2); CreateResponse <ApiPipelineServerResponseModel> createdResponse = await service.Create(model); createdResponse.Success.Should().BeTrue(); ActionResponse deleteResult = await client.PipelineDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiPipelineServerResponseModel verifyResponse = await service.Get(2); verifyResponse.Should().BeNull(); }
public Project([NotNull] IConfiguration configuration, [NotNull] ITraceService trace, [NotNull] IFactory factory, [NotNull] IFileSystem fileSystem, [NotNull] IParseService parseService, [NotNull] IPipelineService pipelines, [NotNull] ICheckerService checker) { Configuration = configuration; Trace = trace; Factory = factory; FileSystem = fileSystem; ParseService = parseService; Pipelines = pipelines; Checker = checker; Context = Factory.ProjectContext(); Indexes = Factory.ProjectIndexes(this); _projectItems = new LockableList <IProjectItem>(this); _diagnostics = new SynchronizedList <IDiagnostic>(); Options = ProjectOptions.Empty; // load databases from configuration foreach (var pair in Configuration.GetSubKeys(Constants.Configuration.Databases)) { var languageNames = Configuration.GetArray(Constants.Configuration.Databases + ":" + pair.Key + ":languages"); _databases[pair.Key.ToUpperInvariant()] = Factory.Database(this, pair.Key, languageNames); } // set Context language var database = GetDatabase(Configuration.GetString(Constants.Configuration.Database, "master")); Assert.IsNotNull(database, "Database specified in 'database' configuration not found"); Context.Language = database.Languages.First(); }
public Worker(ILogger <Worker> logger, IPipelineService pipelineService, IHueService hueService, IOptions <Configuration> config) { _logger = logger; _pipelineService = pipelineService; _hueService = hueService; _config = config.Value; }
public CustomUPRDRequestController(IPipelineService pipelineService, IPipelineEDISettingService pipelineEDISettingService, IUprdStatusService uprdStatusService, INotifierEntityService notifierEntityService) : base(pipelineService) { this.pipelineService = pipelineService; this.pipelineEDISettingService = pipelineEDISettingService; this.uprdStatusService = uprdStatusService; this._notifierEntityService = notifierEntityService; }
public virtual async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); var mapper = new ApiPipelineServerModelMapper(); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; IPipelineService service = testServer.Host.Services.GetService(typeof(IPipelineService)) as IPipelineService; ApiPipelineServerResponseModel model = await service.Get(1); ApiPipelineClientRequestModel request = mapper.MapServerResponseToClientRequest(model); request.SetProperties(1, 2); UpdateResponse <ApiPipelineClientResponseModel> updateResponse = await client.PipelineUpdateAsync(model.Id, request); context.Entry(context.Set <Pipeline>().ToList()[0]).Reload(); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); updateResponse.Record.Id.Should().Be(1); context.Set <Pipeline>().ToList()[0].PipelineStatusId.Should().Be(1); context.Set <Pipeline>().ToList()[0].SaleId.Should().Be(2); updateResponse.Record.Id.Should().Be(1); updateResponse.Record.PipelineStatusId.Should().Be(1); updateResponse.Record.SaleId.Should().Be(2); }
public PipelineDebugController() { CorePipelineService = ServiceLocator.ServiceProvider.GetRequiredService <IPipelineService>(); DiscoveryService = ServiceLocator.ServiceProvider.GetRequiredService <IDiscoveryService>(); SettingsService = ServiceLocator.ServiceProvider.GetRequiredService <ISettingsService>(); OutputService = ServiceLocator.ServiceProvider.GetRequiredService <IOutputService>(); }
public BinFileCompiler([NotNull] IConfiguration configuration, [NotNull] IFactory factory, [NotNull] ITraceService trace, [NotNull] IPipelineService pipelines) : base(1000) { Configuration = configuration; Factory = factory; Trace = trace; Pipelines = pipelines; }
public WorkingProcessController(IWorkingProcessService workingProcessService , ITableService tableService , ITableConfigService tableConfigService , IMasterDataService masterDataService , IOrganizationService organizationService , IStaffService staffService , ILocalizationService localizationService , ITableColumnService tableColumnService , IWorkingdayService workingdayService , IPipelineService pipelineService) { this._workingProcessService = workingProcessService; this._tableService = tableService; this._tableConfigService = tableConfigService; this._masterDataService = masterDataService; this._organizationService = organizationService; this._localizationService = localizationService; this._staffService = staffService; this._workingdayService = workingdayService; this._tableColumnService = tableColumnService; this._pipelineService = pipelineService; this._languageId = CurrentUser.LanguageId; this._userId = CurrentUser.UserId; this._roleId = 1; }
public WebhookController(IPipelineService pipelineService, IFacebookService facebookService, IAccountService accountService, IPageService pageService) { _pipelineService = pipelineService; _facebookService = facebookService; _accountService = accountService; _pageService = pageService; }
protected ValidatorPipe(IPipelineFactory <TInput, TContext> factory, LinkedListNode <Pipeline> node) { if (node != null) { _nextStep = factory.Build(node); } }
public EditOnboardingPipelinePayload(IPipelineService pipelineService) { _pipelineService = pipelineService; Name = nameof(EditOnboardingPipelinePayload); Field <NonNullGraphType <OrganizationPayload> >("organization"); }
protected TemplateTextNodeParserBase([NotNull] IFactory factory, [NotNull] ITraceService trace, [NotNull] IPipelineService pipelines, [NotNull] IReferenceParserService referenceParser, [NotNull] ISchemaService schemaService, double priority) : base(priority) { Factory = factory; Trace = trace; Pipelines = pipelines; ReferenceParser = referenceParser; SchemaService = schemaService; }
public ProjectTree([NotNull] IConfiguration configuration, [NotNull] IFactory factory, [NotNull] IFileSystem fileSystem, [NotNull] IPipelineService pipelines) { Configuration = configuration; Factory = factory; FileSystem = fileSystem; Pipelines = pipelines; PathMatcher = Factory.PathMatcher(Configuration.GetString(Constants.Configuration.Files.Include), Configuration.GetString(Constants.Configuration.Files.Exclude)); }
public PipelineController(IPipelineService pipelineService, IStaffService staffService, IMasterDataService masterDataService, IMenuService menuService, ILocalizationService localizationService) { _pipelineService = pipelineService; _staffService = staffService; _localizationService = localizationService; _masterDataService = masterDataService; _menuService = menuService; _languageId = CurrentUser.LanguageId; }
public AuthenticationServiceTests() { this.pipelineService = Substitute.For <IPipelineService>(); this.fixture = new Fixture(); this.authenticationService = new AuthenticationService(this.pipelineService); this.email = this.fixture.Create <string>(); this.password = this.fixture.Create <string>(); }
public void AddService(PipelineDirection direction, IPipelineService service) { if (direction == PipelineDirection.In) { _inServices.Add(service); } else { _outServices.Add(service); } }
public AddOnboardingStepPayload( IPipelineService pipelineService, IMemberService memberService) { _pipelineService = pipelineService; _memberService = memberService; Name = nameof(AddOnboardingStepPayload); Field <NonNullGraphType <OnboardingPipelinePayload> >("pipeline"); }
public AbstractPipelineController( ApiSettings settings, ILogger <AbstractPipelineController> logger, ITransactionCoordinator transactionCoordinator, IPipelineService pipelineService, IApiPipelineModelMapper pipelineModelMapper ) : base(settings, logger, transactionCoordinator) { this.PipelineService = pipelineService; this.PipelineModelMapper = pipelineModelMapper; }
public AddOnboardingProcessPayload( IOnboardingProcessService processService, IOrganizationService organizationService, IPipelineService pipelineService) { _processService = processService; _organizationService = organizationService; _pipelineService = pipelineService; Name = nameof(AddOnboardingProcessPayload); Field <NonNullGraphType <OrganizationPayload> >("organization"); }
public PipelineController( ApiSettings settings, ILogger <PipelineController> logger, ITransactionCoordinator transactionCoordinator, IPipelineService pipelineService, IApiPipelineServerModelMapper pipelineModelMapper ) : base(settings, logger, transactionCoordinator) { this.PipelineService = pipelineService; this.PipelineModelMapper = pipelineModelMapper; this.BulkInsertLimit = 250; this.MaxLimit = 1000; this.DefaultLimit = 250; }
public UserPipelineMappingController(IPipelineService pipelineService) : base(pipelineService) { this.pipelineService = pipelineService; }
private static IList <TestViewModel> GetFailingTestViewModels(IPipelineUrlResolver urlResolver, IPipelineService pipelineService, IMapper mapper, IConfiguration config) { var tests = pipelineService.GetFailingTests(DateTime.Today.AddDays(-30)).Result; var result = mapper.Map <IEnumerable <TestViewModel> >(tests) .OrderBy(x => x.PipelineName) .ThenByDescending(x => x.StartTime).ToList(); var serverBaseAddress = new Uri(config.GetValue <string>("PipelineServerBaseAddress")); foreach (var test in result) { var jobLogUrl = urlResolver.GetPipelineJobLogUrl(test.PipelineName, test.PipelineRun, test.StageName, test.StageRun, test.JobName); var jobUrl = urlResolver.GetPipelineJobUrl(test.PipelineName, test.PipelineRun, test.StageName, test.StageRun, test.JobName); test.JobLogUrl = new Uri(serverBaseAddress, jobLogUrl).AbsoluteUri; test.JobUrl = new Uri(serverBaseAddress, jobUrl).AbsoluteUri; } return(result); }
public OauthController(IPipelineService pipelineService, IAccountService accountService, IOptions <JwtConfig> options) { _pipelineService = pipelineService; _accountService = accountService; _jwtConfig = options.Value; }
public AuthenticationService(IPipelineService pipelineService) { Assert.ArgumentNotNull(pipelineService, nameof(pipelineService)); this.pipelineService = pipelineService; }
public XmlTemplateTextNodeParser([NotNull] IFactory factory, [NotNull] ITraceService trace, [NotNull] IPipelineService pipelines, [NotNull] IReferenceParserService referenceParser, [NotNull] ISchemaService schemaService) : base(factory, trace, pipelines, referenceParser, schemaService, Constants.TextNodeParsers.Templates) { }
public TransactionalReportingController(IPipelineService pipelineService, ITransactionalReportingService transReportService) { this.transReportService = transReportService; this.pipelineService = pipelineService; }
public PipelineController(IPipelineService pipelineService, IRepository<PipelineView> pipelineRepository) { _pipelineService = pipelineService; _pipelineRepository = pipelineRepository; }