예제 #1
0
        public void SetUp()
        {
            var modulDengiAccessConfig = new ModulDengiAccessConfig
            {
                SiteUrl     = "https://cabinet.moduldengi.ru",
                MyCompanyId = MyCompanyId,
                Credential  = new Credential
                {
                    Login    = "",
                    Password = ""
                }
            };
            var services = new ServiceCollection()
                           .AddOptions()
                           .AddSingleton(Options.Create(modulDengiAccessConfig))
                           .AddTransient <IModulDengiApi, ModulDengiApi>()
                           .AddTransient(provider => new HttpRequestBuilder(enableLogging: false));

            var serviceProvider = services.BuildServiceProvider();

            this.modulDengiApi = serviceProvider.GetService <IModulDengiApi>();
        }
예제 #2
0
 public ModulDengiClient(IModulDengiApi api, IOptions <ModulDengiAccessConfig> accessConfig)
 {
     this.api          = api;
     this.accessConfig = accessConfig.Value;
 }
예제 #3
0
 public ModulDengiApi(IOptions <ModulDengiAccessConfig> accessConfig, HttpRequestBuilder httpRequestBuilder)
 {
     this.httpRequestBuilder = httpRequestBuilder;
     this.accessConfig       = accessConfig.Value;
 }