mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
a610a4769c
* add support for baackground responses to a2a agent * fix line endings * address pr review comments * address pr review comments * update sample to net10.0 * Update dotnet/samples/GettingStarted/A2A/A2AAgent_PollingForTaskCompletion/README.md Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.A2A/Extensions/A2AAgentTaskExtensions.cs Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> * Update dotnet/samples/GettingStarted/A2A/A2AAgent_PollingForTaskCompletion/Program.cs Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> * address pr review feedback * add clarification regarding background responses --------- Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
31 lines
861 B
C#
31 lines
861 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Text.Json;
|
|
|
|
namespace Microsoft.Agents.AI.A2A.UnitTests;
|
|
|
|
/// <summary>
|
|
/// Unit tests for the <see cref="A2AAgentThread"/> class.
|
|
/// </summary>
|
|
public sealed class A2AAgentThreadTests
|
|
{
|
|
[Fact]
|
|
public void Constructor_RoundTrip_SerializationPreservesState()
|
|
{
|
|
// Arrange
|
|
const string ContextId = "context-rt-001";
|
|
const string TaskId = "task-rt-002";
|
|
|
|
A2AAgentThread originalThread = new() { ContextId = ContextId, TaskId = TaskId };
|
|
|
|
// Act
|
|
JsonElement serialized = originalThread.Serialize();
|
|
|
|
A2AAgentThread deserializedThread = new(serialized);
|
|
|
|
// Assert
|
|
Assert.Equal(originalThread.ContextId, deserializedThread.ContextId);
|
|
Assert.Equal(originalThread.TaskId, deserializedThread.TaskId);
|
|
}
|
|
}
|