public ClientTests()
        {
            var builder = new ConfigurationBuilder();

            builder.AddUserSecrets <ClientTests>();
            var configuration = builder.Build();

            this.mockHttpMessageHandler = new Mock <HttpMessageHandler>();
            this.loggerMock             = new Mock <ILogger <FulfillmentClient> >();
            var options = new SecuredFulfillmentClientConfiguration
            {
                FulfillmentService =
                    new FulfillmentClientConfiguration {
                    BaseUri = MockUri, ApiVersion = MockApiVersion
                },
                AzureActiveDirectory = new AuthenticationConfiguration
                {
                    ClientId = Guid.Parse("84aca647-1340-454b-923c-a21a9003b28e"),
                    AppKey   = configuration["FulfillmentClient:AzureActiveDirectory:AppKey"],
                    TenantId = Guid.Parse(configuration["FulfillmentClient:AzureActiveDirectory:TenantId"])
                }
            };

            this.client = new FulfillmentClient(this.mockHttpMessageHandler.Object, options, null, this.loggerMock.Object);
        }
 public FulfillmentClient(
     HttpMessageHandler httpMessageHandler,
     SecuredFulfillmentClientConfiguration options,
     IOperationsStore operationsStore,
     ILogger <FulfillmentClient> logger) : base(options, logger, httpMessageHandler)
 {
     this.operationsStore = operationsStore;
 }
 public FulfillmentClient(SecuredFulfillmentClientConfiguration options,
                          IOperationsStore operationsStore,
                          ILogger <FulfillmentClient> logger) : this(null,
                                                                     options,
                                                                     operationsStore,
                                                                     logger)
 {
 }
Example #4
0
 public CustomMeteringClient(
     SecuredFulfillmentClientConfiguration options,
     ILogger <CustomMeteringClient> logger,
     IKeyVaultHelper keyVaultHelper,
     HttpClient httpClient) : base(options, logger, httpClient)
 {
     _keyVaultHelper = keyVaultHelper ?? throw new ArgumentNullException(nameof(keyVaultHelper));
     _logger         = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Example #5
0
 protected RestClient(
     SecuredFulfillmentClientConfiguration securedFulfillmentClientConfiguration,
     ILogger <T> instanceLogger,
     HttpMessageHandler messageHandler)
 {
     this.options            = securedFulfillmentClientConfiguration;
     this.logger             = instanceLogger;
     this.baseUri            = securedFulfillmentClientConfiguration.FulfillmentService.BaseUri;
     this.apiVersion         = securedFulfillmentClientConfiguration.FulfillmentService.ApiVersion;
     this.httpMessageHandler = messageHandler;
 }
Example #6
0
        public WebhookProcessor(
            SecuredFulfillmentClientConfiguration options,
            IFulfillmentClient fulfillmentClient,
            IWebhookHandler webhookHandler,
            ILogger <WebhookProcessor> logger)
        {
            this.options = options;

            this.fulfillmentClient = fulfillmentClient;
            this.logger            = logger;
            this.webhookHandler    = webhookHandler;
        }
 public FulfillmentClient(
     HttpMessageHandler httpMessageHandler,
     SecuredFulfillmentClientConfiguration options,
     ILogger <FulfillmentClient> logger) : base(options, logger, httpMessageHandler)
 {
 }
Example #8
0
 public CustomMeteringClient(SecuredFulfillmentClientConfiguration options,
                             ILogger <CustomMeteringClient> logger) : this(null,
                                                                           options,
                                                                           logger)
 {
 }