PR feedback fixes

This commit is contained in:
Shyju Krishnankutty
2026-03-18 14:56:43 -07:00
parent c8991857b0
commit 2fe2f4400a
6 changed files with 66 additions and 20 deletions
@@ -264,7 +264,8 @@ public sealed class WorkflowSamplesValidation(ITestOutputHelper outputHelper) :
"Translate",
arguments: new Dictionary<string, object?> { { "input", "hello world" } });
string translateResponse = ((TextContentBlock)translateResult.Content[0]).Text;
Assert.NotEmpty(translateResult.Content);
string translateResponse = Assert.IsType<TextContentBlock>(translateResult.Content[0]).Text;
this._outputHelper.WriteLine($"Translate MCP tool response: {translateResponse}");
Assert.NotEmpty(translateResponse);
Assert.Contains("HELLO WORLD", translateResponse);
@@ -275,7 +276,8 @@ public sealed class WorkflowSamplesValidation(ITestOutputHelper outputHelper) :
"OrderLookup",
arguments: new Dictionary<string, object?> { { "input", "ORD-2025-42" } });
string orderResponse = ((TextContentBlock)orderResult.Content[0]).Text;
Assert.NotEmpty(orderResult.Content);
string orderResponse = Assert.IsType<TextContentBlock>(orderResult.Content[0]).Text;
this._outputHelper.WriteLine($"OrderLookup MCP tool response: {orderResponse}");
Assert.NotEmpty(orderResponse);
Assert.Contains("ORD-2025-42", orderResponse);
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.
using System.Text.Json;
using Microsoft.Azure.Functions.Worker.Core.FunctionMetadata;
namespace Microsoft.Agents.AI.Hosting.AzureFunctions.UnitTests;
@@ -88,6 +89,12 @@ public sealed class FunctionMetadataFactoryTests
Assert.NotNull(metadata.RawBindings);
Assert.Equal(3, metadata.RawBindings.Count);
// Verify all bindings are valid JSON
foreach (string binding in metadata.RawBindings)
{
JsonDocument.Parse(binding);
}
// mcpToolTrigger binding
Assert.Contains("mcpToolTrigger", metadata.RawBindings[0]);
Assert.Contains("\"toolName\":\"Translate\"", metadata.RawBindings[0]);