From f7dc5262f6c9055fb0ce5cd087722077bfdc74b0 Mon Sep 17 00:00:00 2001 From: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com> Date: Mon, 11 Nov 2024 11:16:09 +0000 Subject: [PATCH] .Net: Fix unit tests to check for security property (#9635) ### Motivation and Context ### Description ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone :smile: --- .../OpenApi/Extensions/OpenApiKernelExtensionsTests.cs | 4 ++-- .../OpenApi/OpenApiKernelPluginFactoryTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dotnet/src/Functions/Functions.UnitTests/OpenApi/Extensions/OpenApiKernelExtensionsTests.cs b/dotnet/src/Functions/Functions.UnitTests/OpenApi/Extensions/OpenApiKernelExtensionsTests.cs index a18982d4e547..e19d5885babb 100644 --- a/dotnet/src/Functions/Functions.UnitTests/OpenApi/Extensions/OpenApiKernelExtensionsTests.cs +++ b/dotnet/src/Functions/Functions.UnitTests/OpenApi/Extensions/OpenApiKernelExtensionsTests.cs @@ -294,8 +294,8 @@ public async Task ItShouldReplicateMetadataToOperationAsync(string documentFileN Assert.Equal(["https://my-key-vault.vault.azure.net"], serverUrls); var info = additionalProperties["info"] as RestApiInfo; Assert.NotNull(info); - var security = additionalProperties["info"] as List; - Assert.Null(security); + var security = additionalProperties["security"] as List; + Assert.NotNull(security); // Assert Operation Extension keys var operationExtensions = additionalProperties["operation-extensions"] as Dictionary; diff --git a/dotnet/src/Functions/Functions.UnitTests/OpenApi/OpenApiKernelPluginFactoryTests.cs b/dotnet/src/Functions/Functions.UnitTests/OpenApi/OpenApiKernelPluginFactoryTests.cs index 491f8ba84064..6c70921424eb 100644 --- a/dotnet/src/Functions/Functions.UnitTests/OpenApi/OpenApiKernelPluginFactoryTests.cs +++ b/dotnet/src/Functions/Functions.UnitTests/OpenApi/OpenApiKernelPluginFactoryTests.cs @@ -285,8 +285,8 @@ public async Task ItShouldReplicateMetadataToOperationAsync(string documentFileN Assert.Equal(["https://my-key-vault.vault.azure.net"], serverUrls); var info = additionalProperties["info"] as RestApiInfo; Assert.NotNull(info); - var security = additionalProperties["info"] as List; - Assert.Null(security); + var security = additionalProperties["security"] as List; + Assert.NotNull(security); // Assert Operation Extension keys var operationExtensions = additionalProperties["operation-extensions"] as Dictionary;