mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Update test name prefix for clarity.
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Microsoft.Agents.AI.Workflows.UnitTests;
|
||||
public class AggregatingExecutorTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Test_HandleAsync_AggregatesIncrementallyAsync()
|
||||
public async Task AggregatingExecutor_HandleAsync_AggregatesIncrementallyAsync()
|
||||
{
|
||||
AggregatingExecutor<string, string> executor = new("sum", (aggregate, input) =>
|
||||
aggregate == null ? input : $"{aggregate}+{input}");
|
||||
@@ -25,7 +25,7 @@ public class AggregatingExecutorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_HandleAsync_FirstCallReceivesNullAggregateAsync()
|
||||
public async Task AggregatingExecutor_HandleAsync_FirstCallReceivesNullAggregateAsync()
|
||||
{
|
||||
string? receivedAggregate = "sentinel";
|
||||
|
||||
@@ -42,7 +42,7 @@ public class AggregatingExecutorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_HandleAsync_AggregatorReturningNullClearsStateAsync()
|
||||
public async Task AggregatingExecutor_HandleAsync_AggregatorReturningNullClearsStateAsync()
|
||||
{
|
||||
AggregatingExecutor<string, string> executor = new("nullable", (aggregate, input) =>
|
||||
input == "clear" ? null : (aggregate ?? "") + input);
|
||||
@@ -61,7 +61,7 @@ public class AggregatingExecutorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_HandleAsync_PersistsStateBetweenCallsAsync()
|
||||
public async Task AggregatingExecutor_HandleAsync_PersistsStateBetweenCallsAsync()
|
||||
{
|
||||
AggregatingExecutor<string, string> executor = new("counter", (aggregate, _) =>
|
||||
aggregate == null ? "1" : $"{int.Parse(aggregate) + 1}");
|
||||
|
||||
+9
-9
@@ -19,7 +19,7 @@ public sealed class InputWaiterTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_WaitForInputAsync_CompletesAfterSignalAsync()
|
||||
public async Task InputWaiter_WaitForInputAsync_CompletesAfterSignalAsync()
|
||||
{
|
||||
this._waiter.SignalInput();
|
||||
|
||||
@@ -31,7 +31,7 @@ public sealed class InputWaiterTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_WaitForInputAsync_BlocksUntilSignaledAsync()
|
||||
public async Task InputWaiter_WaitForInputAsync_BlocksUntilSignaledAsync()
|
||||
{
|
||||
Task waitTask = this._waiter.WaitForInputAsync(TimeSpan.FromSeconds(5));
|
||||
|
||||
@@ -45,7 +45,7 @@ public sealed class InputWaiterTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_SignalInput_DoubleSignalDoesNotThrow()
|
||||
public void InputWaiter_SignalInput_DoubleSignalDoesNotThrow()
|
||||
{
|
||||
// Binary semaphore behavior: double signal should be idempotent
|
||||
FluentActions.Invoking(() =>
|
||||
@@ -56,7 +56,7 @@ public sealed class InputWaiterTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_WaitForInputAsync_RespectsCancellationAsync()
|
||||
public async Task InputWaiter_WaitForInputAsync_RespectsCancellationAsync()
|
||||
{
|
||||
using CancellationTokenSource cts = new();
|
||||
Task waitTask = this._waiter.WaitForInputAsync(cts.Token);
|
||||
@@ -68,7 +68,7 @@ public sealed class InputWaiterTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_WaitForInputAsync_DoesNotCompleteWhenNotSignaledAsync()
|
||||
public async Task InputWaiter_WaitForInputAsync_DoesNotCompleteWhenNotSignaledAsync()
|
||||
{
|
||||
using CancellationTokenSource cts = new();
|
||||
Task waitTask = this._waiter.WaitForInputAsync(cts.Token);
|
||||
@@ -83,7 +83,7 @@ public sealed class InputWaiterTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_WaitForInputAsync_CanBeSignaledMultipleTimesSequentiallyAsync()
|
||||
public async Task InputWaiter_WaitForInputAsync_CanBeSignaledMultipleTimesSequentiallyAsync()
|
||||
{
|
||||
// First signal/wait cycle
|
||||
this._waiter.SignalInput();
|
||||
@@ -111,7 +111,7 @@ public class OutputFilterTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_CanOutput_ReturnsTrueForRegisteredExecutor()
|
||||
public void OutputFilter_CanOutput_ReturnsTrueForRegisteredExecutor()
|
||||
{
|
||||
OutputFilter filter = CreateFilterWithOutputFrom("end");
|
||||
|
||||
@@ -119,7 +119,7 @@ public class OutputFilterTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_CanOutput_ReturnsFalseForUnregisteredExecutor()
|
||||
public void OutputFilter_CanOutput_ReturnsFalseForUnregisteredExecutor()
|
||||
{
|
||||
OutputFilter filter = CreateFilterWithOutputFrom("end");
|
||||
|
||||
@@ -127,7 +127,7 @@ public class OutputFilterTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_CanOutput_ReturnsFalseForNonExistentExecutor()
|
||||
public void OutputFilter_CanOutput_ReturnsFalseForNonExistentExecutor()
|
||||
{
|
||||
OutputFilter filter = CreateFilterWithOutputFrom("end");
|
||||
|
||||
|
||||
+8
-8
@@ -11,7 +11,7 @@ namespace Microsoft.Agents.AI.Workflows.UnitTests;
|
||||
public class RoundRobinGroupChatManagerTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Test_SelectNextAgent_CyclesInOrderAsync()
|
||||
public async Task RoundRobinGroupChat_SelectNextAgent_CyclesInOrderAsync()
|
||||
{
|
||||
TestEchoAgent agent1 = new(id: "agent1");
|
||||
TestEchoAgent agent2 = new(id: "agent2");
|
||||
@@ -31,7 +31,7 @@ public class RoundRobinGroupChatManagerTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_SelectNextAgent_WrapsAroundAsync()
|
||||
public async Task RoundRobinGroupChat_SelectNextAgent_WrapsAroundAsync()
|
||||
{
|
||||
TestEchoAgent agent1 = new(id: "agent1");
|
||||
TestEchoAgent agent2 = new(id: "agent2");
|
||||
@@ -49,7 +49,7 @@ public class RoundRobinGroupChatManagerTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_ShouldTerminate_DefaultBehaviorTerminatesAtMaxIterationsAsync()
|
||||
public async Task RoundRobinGroupChat_ShouldTerminate_DefaultBehaviorTerminatesAtMaxIterationsAsync()
|
||||
{
|
||||
TestEchoAgent agent1 = new(id: "agent1");
|
||||
List<AIAgent> agents = [agent1];
|
||||
@@ -67,7 +67,7 @@ public class RoundRobinGroupChatManagerTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_ShouldTerminate_CustomFuncTerminatesEarlyAsync()
|
||||
public async Task RoundRobinGroupChat_ShouldTerminate_CustomFuncTerminatesEarlyAsync()
|
||||
{
|
||||
TestEchoAgent agent1 = new(id: "agent1");
|
||||
List<AIAgent> agents = [agent1];
|
||||
@@ -84,7 +84,7 @@ public class RoundRobinGroupChatManagerTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_ShouldTerminate_CustomFuncDoesNotTerminateWhenNotMetAsync()
|
||||
public async Task RoundRobinGroupChat_ShouldTerminate_CustomFuncDoesNotTerminateWhenNotMetAsync()
|
||||
{
|
||||
TestEchoAgent agent1 = new(id: "agent1");
|
||||
List<AIAgent> agents = [agent1];
|
||||
@@ -101,7 +101,7 @@ public class RoundRobinGroupChatManagerTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Test_Reset_ResetsIterationCountAndAgentIndexAsync()
|
||||
public async Task RoundRobinGroupChat_Reset_ResetsIterationCountAndAgentIndexAsync()
|
||||
{
|
||||
TestEchoAgent agent1 = new(id: "agent1");
|
||||
TestEchoAgent agent2 = new(id: "agent2");
|
||||
@@ -123,14 +123,14 @@ public class RoundRobinGroupChatManagerTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_Constructor_ThrowsOnNullAgents()
|
||||
public void RoundRobinGroupChat_Constructor_ThrowsOnNullAgents()
|
||||
{
|
||||
FluentActions.Invoking(() => new RoundRobinGroupChatManager(null!))
|
||||
.Should().Throw<System.ArgumentException>();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_Constructor_ThrowsOnEmptyAgents()
|
||||
public void RoundRobinGroupChat_Constructor_ThrowsOnEmptyAgents()
|
||||
{
|
||||
FluentActions.Invoking(() => new RoundRobinGroupChatManager([]))
|
||||
.Should().Throw<System.ArgumentException>();
|
||||
|
||||
Reference in New Issue
Block a user