mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Address review feedback: simplify Throw.IfNull in SwitchBuilder per westey-m suggestion
Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/299950fd-4457-47f3-a373-f65d601b7ea5 Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
6b8b43065a
commit
14b9c02c52
@@ -39,7 +39,7 @@ public sealed class SwitchBuilder
|
||||
|
||||
foreach (ExecutorBinding executor in executors)
|
||||
{
|
||||
Throw.IfNull(executor, nameof(executors));
|
||||
Throw.IfNull(executor);
|
||||
|
||||
if (!this._executorIndicies.TryGetValue(executor.Id, out int index))
|
||||
{
|
||||
@@ -68,7 +68,7 @@ public sealed class SwitchBuilder
|
||||
|
||||
foreach (ExecutorBinding executor in executors)
|
||||
{
|
||||
Throw.IfNull(executor, nameof(executors));
|
||||
Throw.IfNull(executor);
|
||||
|
||||
if (!this._executorIndicies.TryGetValue(executor.Id, out int index))
|
||||
{
|
||||
|
||||
@@ -445,9 +445,9 @@ public partial class WorkflowBuilderSmokeTests
|
||||
// Act/Assert
|
||||
Assert.Throws<ArgumentNullException>("predicate", () => switchBuilder.AddCase<string>(null!, [target]));
|
||||
Assert.Throws<ArgumentNullException>("executors", () => switchBuilder.AddCase<string>(_ => true, null!));
|
||||
Assert.Throws<ArgumentNullException>("executors", () => switchBuilder.AddCase<string>(_ => true, [target, null!]));
|
||||
Assert.Throws<ArgumentNullException>("executor", () => switchBuilder.AddCase<string>(_ => true, [target, null!]));
|
||||
Assert.Throws<ArgumentNullException>("executors", () => switchBuilder.WithDefault(null!));
|
||||
Assert.Throws<ArgumentNullException>("executors", () => switchBuilder.WithDefault([target, null!]));
|
||||
Assert.Throws<ArgumentNullException>("executor", () => switchBuilder.WithDefault([target, null!]));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user