diff --git a/test/AzureOpenAIProxy.ApiApp.Tests/Extensions/ServiceCollectionExtensionsTests.cs b/test/AzureOpenAIProxy.ApiApp.Tests/Extensions/ServiceCollectionExtensionsTests.cs index 47cf8847..5a77eda8 100644 --- a/test/AzureOpenAIProxy.ApiApp.Tests/Extensions/ServiceCollectionExtensionsTests.cs +++ b/test/AzureOpenAIProxy.ApiApp.Tests/Extensions/ServiceCollectionExtensionsTests.cs @@ -108,9 +108,9 @@ public void Given_NullOrEmpty_VaultUri_When_Invoked_AddKeyVaultService_Then_It_S } [Theory] - [InlineData("http://localhost", default(string))] - [InlineData("http://localhost", "")] - public void Given_NullOrEmpty_SecretName_When_Invoked_AddKeyVaultService_Then_It_Should_Throw_Exception(string vaultUri, string? secretName) + [InlineData("http://localhost", default(string), typeof(KeyNotFoundException))] + [InlineData("http://localhost", "", typeof(InvalidOperationException))] + public void Given_NullOrEmpty_SecretName_When_Invoked_AddKeyVaultService_Then_It_Should_Throw_Exception(string vaultUri, string? secretName, Type exceptionType) { // Arrange var services = new ServiceCollection(); @@ -129,7 +129,7 @@ public void Given_NullOrEmpty_SecretName_When_Invoked_AddKeyVaultService_Then_It Action action = () => services.BuildServiceProvider().GetService(); // Assert - action.Should().Throw(); + action.Should().Throw().Which.Should().BeOfType(exceptionType); } [Theory]