private void SetupSUT() { var env = IEXCloudClientOptions.IEXCloudClientOptionsEnvironment.Sandbox; var version = IEXCloudClientOptions.IEXCloudClientOptionsVersion.V1; var options = new IEXCloudClientOptions(env, version, "pk", "st"); client = new IEXCloudClient(options, httpClientFactoryMock.Object); }
public static IEXCloudClientOptions ReadConfig(IConfigurationRoot configuration) { var publicToken = configuration["PublishableToken"]; var secretToken = configuration["SecretToken"]; Enum.TryParse(configuration["Environment"], true, out IEXCloudClientOptionsEnvironment environment); Enum.TryParse(configuration["Version"], true, out IEXCloudClientOptionsVersion version); var options = new IEXCloudClientOptions(environment, version, publicToken, secretToken); return(options); }
public static IServiceCollection AddIEXClient(this IServiceCollection services, IEXCloudClientOptions options) { services.AddHttpClient(); services.AddSingleton <IIEXCloudClient, IEXCloudClient>(); services.AddSingleton(options); return(services); }