Constructor and Configuration Tests
| 32 | |
| 33 | // Constructor and Configuration Tests |
| 34 | TEST_F(OpenAIClientTest, ConstructorWithValidApiKey) { |
| 35 | ai::openai::OpenAIClient client("sk-validkey123", "https://api.openai.com"); |
| 36 | |
| 37 | EXPECT_TRUE(client.is_valid()); |
| 38 | EXPECT_EQ(client.provider_name(), "openai"); |
| 39 | EXPECT_THAT(client.config_info(), testing::HasSubstr("OpenAI API")); |
| 40 | |
| 41 | // Test public interface access only |
| 42 | EXPECT_EQ(client.get_api_key(), "sk-validkey123"); |
| 43 | EXPECT_EQ(client.get_base_url(), "https://api.openai.com"); |
| 44 | // Commented out internal method tests that don't exist: |
| 45 | // EXPECT_EQ(client.get_host(), "api.openai.com"); |
| 46 | // EXPECT_TRUE(client.get_use_ssl()); |
| 47 | } |
| 48 | |
| 49 | TEST_F(OpenAIClientTest, ConstructorWithEmptyApiKey) { |
| 50 | ai::openai::OpenAIClient client("", "https://api.openai.com"); |
nothing calls this directly
no test coverage detected