mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
a6b6937b94
* Checkpoint * Checkpoint * Checkpoint * Good * Namespace * Namespace * Dun * Async Test * AgentId * Portable pattern * Portable2 * Portable3 * Respond to comments * Namespace * Function call selection * ToHashSet * ToHashSet * Updated * Parameter name * Final * Tests
22 lines
605 B
C#
22 lines
605 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Text.Json;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests;
|
|
|
|
/// <summary>
|
|
/// Base class for event tests.
|
|
/// </summary>
|
|
public abstract class EventTest(ITestOutputHelper output) : WorkflowTest(output)
|
|
{
|
|
protected static TEvent VerifyEventSerialization<TEvent>(TEvent source)
|
|
{
|
|
string? text = JsonSerializer.Serialize(source);
|
|
Assert.NotNull(text);
|
|
TEvent? copy = JsonSerializer.Deserialize<TEvent>(text);
|
|
Assert.NotNull(copy);
|
|
return copy;
|
|
}
|
|
}
|