2024-07-03 16:57:27 -05:00
|
|
|
namespace AnthropicClient.Tests.Fixtures;
|
2024-06-27 23:26:53 -05:00
|
|
|
|
|
|
|
|
public class ConfigurationFixture
|
|
|
|
|
{
|
|
|
|
|
public string AnthropicApiKey { get; }
|
|
|
|
|
|
|
|
|
|
public ConfigurationFixture()
|
|
|
|
|
{
|
|
|
|
|
var configuration = new ConfigurationBuilder()
|
2024-07-07 16:21:16 -05:00
|
|
|
.AddJsonFile("appsettings.Test.json", optional: true)
|
2024-06-27 23:26:53 -05:00
|
|
|
.AddEnvironmentVariables()
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
var anthropicApiKey = configuration["AnthropicApiKey"];
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(anthropicApiKey))
|
|
|
|
|
{
|
|
|
|
|
throw new InvalidOperationException("AnthropicApiKey is required");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AnthropicApiKey = anthropicApiKey;
|
|
|
|
|
}
|
|
|
|
|
}
|