Files
agent-framework/dotnet/tests/Microsoft.Extensions.AI.Agents.A2A.UnitTests/Extensions/A2AClientExtensionsTests.cs
T
SergeyMenshykh 1d2f833122 .NET: A2A agent (#520)
* add a2a agent

* Update dotnet/src/Microsoft.Extensions.AI.Agents.A2A/A2AAgent.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* address pr review feedback

* move unit tests for extension methods to the extensions folder

* address pr review comments

* address pr review comments

* address pr review feedback

* move a2a agent sample to console app

* remove unnecessary Ids set for new projects in the solution file

* remove unnecessary configuration

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-01 08:30:30 +00:00

36 lines
1.1 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
using System;
using A2A;
namespace Microsoft.Extensions.AI.Agents.A2A.UnitTests;
/// <summary>
/// Unit tests for the <see cref="A2AClientExtensions"/> class.
/// </summary>
public sealed class A2AClientExtensionsTests
{
[Fact]
public void GetAIAgent_WithAllParameters_ReturnsA2AAgentWithSpecifiedProperties()
{
// Arrange
var a2aClient = new A2AClient(new Uri("http://test-endpoint"));
const string TestId = "test-agent-id";
const string TestName = "Test Agent";
const string TestDescription = "This is a test agent description";
const string TestDisplayName = "Test Display Name";
// Act
var agent = a2aClient.GetAIAgent(TestId, TestName, TestDescription, TestDisplayName);
// Assert
Assert.NotNull(agent);
Assert.IsType<A2AAgent>(agent);
Assert.Equal(TestId, agent.Id);
Assert.Equal(TestName, agent.Name);
Assert.Equal(TestDescription, agent.Description);
Assert.Equal(TestDisplayName, agent.DisplayName);
}
}