From ae6b23c8d812b27ffc77c291ab53b5ac7043bf1f Mon Sep 17 00:00:00 2001 From: Shyju Krishnankutty Date: Tue, 3 Mar 2026 17:01:24 -0800 Subject: [PATCH] Fix dotnet format issues: add UTF-8 BOM and remove unused using - Add UTF-8 BOM to 20 .cs files across DurableTask, AzureFunctions, unit tests, and workflow samples - Remove unnecessary using directive in 07_SubWorkflows/Executors.cs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ConsoleApps/07_SubWorkflows/Executors.cs | 1 - .../DurableOptions.cs | 2 +- .../Microsoft.Agents.AI.DurableTask/Logs.cs | 2 +- .../ServiceCollectionExtensions.cs | 2 +- .../Workflows/DurableExecutorDispatcher.cs | 2 +- .../Workflows/DurableRunStatus.cs | 2 +- .../Workflows/DurableWorkflowContext.cs | 2 +- .../Workflows/DurableWorkflowJsonContext.cs | 2 +- .../Workflows/DurableWorkflowLiveStatus.cs | 2 +- .../Workflows/DurableWorkflowOptions.cs | 2 +- .../Workflows/DurableWorkflowRunner.cs | 2 +- .../DurableWorkflowWaitingForInputEvent.cs | 2 +- .../Workflows/IStreamingWorkflowRun.cs | 2 +- .../Workflows/PendingRequestPortStatus.cs | 2 +- .../BuiltInFunctionExecutor.cs | 2 +- .../FunctionMetadataFactory.cs | 2 +- .../FunctionsApplicationBuilderExtensions.cs | 2 +- .../FunctionsDurableOptions.cs | 2 +- .../DurableWorkflowOptionsExtensions.cs | 2 +- .../ConsoleAppSamplesValidation.cs | 2 +- .../WorkflowConsoleAppSamplesValidation.cs | 2 +- .../Workflows/DurableActivityExecutorTests.cs | 2 +- .../DurableStreamingWorkflowRunTests.cs | 2 +- .../Workflows/DurableWorkflowContextTests.cs | 58 +++++++++---------- .../WorkflowSamplesValidation.cs | 2 +- 25 files changed, 52 insertions(+), 53 deletions(-) diff --git a/dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/07_SubWorkflows/Executors.cs b/dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/07_SubWorkflows/Executors.cs index 25c7228642..121db7af67 100644 --- a/dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/07_SubWorkflows/Executors.cs +++ b/dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/07_SubWorkflows/Executors.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.Workflows; -using Microsoft.Agents.AI.Workflows.Checkpointing; namespace SubWorkflows; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/DurableOptions.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/DurableOptions.cs index 136eb1fb3d..d7f289b223 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/DurableOptions.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/DurableOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Diagnostics; using Microsoft.Agents.AI.DurableTask.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Logs.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Logs.cs index fdf09749b5..57ef010a2f 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Logs.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Logs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.DurableTask; using Microsoft.Extensions.AI; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/ServiceCollectionExtensions.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/ServiceCollectionExtensions.cs index ee9f0c77d6..456e4ae98d 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/ServiceCollectionExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.DurableTask.Workflows; using Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableExecutorDispatcher.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableExecutorDispatcher.cs index ce68b5c0d9..b2440cfd83 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableExecutorDispatcher.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableExecutorDispatcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // ConfigureAwait Usage in Orchestration Code: // This file uses ConfigureAwait(true) because it runs within orchestration context. diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableRunStatus.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableRunStatus.cs index 4ed2049dc9..cff00a84ca 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableRunStatus.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableRunStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. namespace Microsoft.Agents.AI.DurableTask.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowContext.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowContext.cs index 9ddb337561..5f98f5dc59 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowContext.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowJsonContext.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowJsonContext.cs index e68ec842a8..12f4c490b9 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowJsonContext.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowJsonContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Text.Json.Serialization; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowLiveStatus.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowLiveStatus.cs index 1568755800..5e381ce0eb 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowLiveStatus.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowLiveStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowOptions.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowOptions.cs index 52cb54b20a..67a21c9100 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowOptions.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Diagnostics; using Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowRunner.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowRunner.cs index 942d4ecc9a..b458bf98b0 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowRunner.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowRunner.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // ConfigureAwait Usage in Orchestration Code: // This file uses ConfigureAwait(true) because it runs within orchestration context. diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowWaitingForInputEvent.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowWaitingForInputEvent.cs index 86532852c8..ed93c5928b 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowWaitingForInputEvent.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowWaitingForInputEvent.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/IStreamingWorkflowRun.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/IStreamingWorkflowRun.cs index 79771e8bd2..079ee7258e 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/IStreamingWorkflowRun.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/IStreamingWorkflowRun.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/PendingRequestPortStatus.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/PendingRequestPortStatus.cs index d75ea1427d..c60f00d5f6 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/PendingRequestPortStatus.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/PendingRequestPortStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. namespace Microsoft.Agents.AI.DurableTask.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/BuiltInFunctionExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/BuiltInFunctionExecutor.cs index 25200c30bb..8239ff17cc 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/BuiltInFunctionExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/BuiltInFunctionExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Context.Features; diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionMetadataFactory.cs b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionMetadataFactory.cs index f50f3a03be..d88cd939d9 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionMetadataFactory.cs +++ b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionMetadataFactory.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.DurableTask; using Microsoft.Azure.Functions.Worker.Core.FunctionMetadata; diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionsApplicationBuilderExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionsApplicationBuilderExtensions.cs index 9cf22b27f7..ceb47c389a 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionsApplicationBuilderExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionsApplicationBuilderExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.DurableTask; using Microsoft.Agents.AI.DurableTask.Workflows; diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionsDurableOptions.cs b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionsDurableOptions.cs index 1d67166aaa..6e7b6ec5a8 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionsDurableOptions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/FunctionsDurableOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.DurableTask; diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/Workflows/DurableWorkflowOptionsExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/Workflows/DurableWorkflowOptionsExtensions.cs index de822cfa45..6f40cbb791 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/Workflows/DurableWorkflowOptionsExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Hosting.AzureFunctions/Workflows/DurableWorkflowOptionsExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.DurableTask.Workflows; using Microsoft.Agents.AI.Workflows; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs index 8e93ff3b1a..217eb66010 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Collections.Concurrent; using System.Diagnostics; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/WorkflowConsoleAppSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/WorkflowConsoleAppSamplesValidation.cs index 9c1b58f166..2ab3b476c1 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/WorkflowConsoleAppSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/WorkflowConsoleAppSamplesValidation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Xunit.Abstractions; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableActivityExecutorTests.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableActivityExecutorTests.cs index 6b817fe84b..e3b549e365 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableActivityExecutorTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableActivityExecutorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Text.Json; using Microsoft.Agents.AI.DurableTask.Workflows; diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableStreamingWorkflowRunTests.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableStreamingWorkflowRunTests.cs index 4f07167942..8aef99e3e1 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableStreamingWorkflowRunTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableStreamingWorkflowRunTests.cs @@ -624,7 +624,7 @@ public sealed class DurableStreamingWorkflowRunTests // Act & Assert await Assert.ThrowsAsync(() => - run.SendResponseAsync(null!, "response").AsTask()); + run.SendResponseAsync(null!, "response").AsTask()); } #endregion diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableWorkflowContextTests.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableWorkflowContextTests.cs index 7437bb6e1d..4ceba544a2 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableWorkflowContextTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableWorkflowContextTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI.DurableTask.Workflows; using Microsoft.Agents.AI.Workflows; @@ -13,7 +13,7 @@ public sealed class DurableWorkflowContextTests #region ReadStateAsync [Fact] - public async Task ReadStateAsync_KeyExistsInInitialState_ReturnsValue() + public async Task ReadStateAsync_KeyExistsInInitialState_ReturnsValueAsync() { // Arrange Dictionary state = new() { ["__default__:counter"] = "42" }; @@ -27,7 +27,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadStateAsync_KeyDoesNotExist_ReturnsNull() + public async Task ReadStateAsync_KeyDoesNotExist_ReturnsNullAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -40,7 +40,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadStateAsync_LocalUpdateTakesPriorityOverInitialState() + public async Task ReadStateAsync_LocalUpdateTakesPriorityOverInitialStateAsync() { // Arrange Dictionary state = new() { ["__default__:key"] = "\"old\"" }; @@ -55,7 +55,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadStateAsync_ScopeCleared_IgnoresInitialState() + public async Task ReadStateAsync_ScopeCleared_IgnoresInitialStateAsync() { // Arrange Dictionary state = new() { ["__default__:key"] = "\"value\"" }; @@ -70,7 +70,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadStateAsync_WithNamedScope_ReadsFromCorrectScope() + public async Task ReadStateAsync_WithNamedScope_ReadsFromCorrectScopeAsync() { // Arrange Dictionary state = new() @@ -92,7 +92,7 @@ public sealed class DurableWorkflowContextTests [Theory] [InlineData(null)] [InlineData("")] - public async Task ReadStateAsync_NullOrEmptyKey_ThrowsArgumentException(string? key) + public async Task ReadStateAsync_NullOrEmptyKey_ThrowsArgumentExceptionAsync(string? key) { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -106,7 +106,7 @@ public sealed class DurableWorkflowContextTests #region ReadOrInitStateAsync [Fact] - public async Task ReadOrInitStateAsync_KeyDoesNotExist_CallsFactoryAndQueuesUpdate() + public async Task ReadOrInitStateAsync_KeyDoesNotExist_CallsFactoryAndQueuesUpdateAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -120,7 +120,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadOrInitStateAsync_KeyExists_ReturnsExistingValue() + public async Task ReadOrInitStateAsync_KeyExists_ReturnsExistingValueAsync() { // Arrange Dictionary state = new() { ["__default__:key"] = "\"existing\"" }; @@ -142,7 +142,7 @@ public sealed class DurableWorkflowContextTests [Theory] [InlineData(null)] [InlineData("")] - public async Task ReadOrInitStateAsync_NullOrEmptyKey_ThrowsArgumentException(string? key) + public async Task ReadOrInitStateAsync_NullOrEmptyKey_ThrowsArgumentExceptionAsync(string? key) { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -153,7 +153,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadOrInitStateAsync_ValueType_MissingKey_CallsFactory() + public async Task ReadOrInitStateAsync_ValueType_MissingKey_CallsFactoryAsync() { // Arrange // Validates that ReadStateAsync returns null (not 0) for missing keys, @@ -170,7 +170,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadOrInitStateAsync_NullFactory_ThrowsArgumentNullException() + public async Task ReadOrInitStateAsync_NullFactory_ThrowsArgumentNullExceptionAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -185,7 +185,7 @@ public sealed class DurableWorkflowContextTests #region QueueStateUpdateAsync [Fact] - public async Task QueueStateUpdateAsync_SetsValue_VisibleToSubsequentRead() + public async Task QueueStateUpdateAsync_SetsValue_VisibleToSubsequentReadAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -199,7 +199,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task QueueStateUpdateAsync_NullValue_RecordsDeletion() + public async Task QueueStateUpdateAsync_NullValue_RecordsDeletionAsync() { // Arrange Dictionary state = new() { ["__default__:key"] = "\"value\"" }; @@ -216,7 +216,7 @@ public sealed class DurableWorkflowContextTests [Theory] [InlineData(null)] [InlineData("")] - public async Task QueueStateUpdateAsync_NullOrEmptyKey_ThrowsArgumentException(string? key) + public async Task QueueStateUpdateAsync_NullOrEmptyKey_ThrowsArgumentExceptionAsync(string? key) { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -231,7 +231,7 @@ public sealed class DurableWorkflowContextTests #region QueueClearScopeAsync [Fact] - public async Task QueueClearScopeAsync_DefaultScope_ClearsStateAndPendingUpdates() + public async Task QueueClearScopeAsync_DefaultScope_ClearsStateAndPendingUpdatesAsync() { // Arrange Dictionary state = new() { ["__default__:key"] = "\"value\"" }; @@ -247,7 +247,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task QueueClearScopeAsync_NamedScope_OnlyClearsThatScope() + public async Task QueueClearScopeAsync_NamedScope_OnlyClearsThatScopeAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -267,7 +267,7 @@ public sealed class DurableWorkflowContextTests #region ReadStateKeysAsync [Fact] - public async Task ReadStateKeysAsync_ReturnsKeysFromInitialState() + public async Task ReadStateKeysAsync_ReturnsKeysFromInitialStateAsync() { // Arrange Dictionary state = new() @@ -287,7 +287,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadStateKeysAsync_MergesLocalUpdatesAndDeletions() + public async Task ReadStateKeysAsync_MergesLocalUpdatesAndDeletionsAsync() { // Arrange Dictionary state = new() @@ -309,7 +309,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadStateKeysAsync_AfterClearScope_ExcludesInitialState() + public async Task ReadStateKeysAsync_AfterClearScope_ExcludesInitialStateAsync() { // Arrange Dictionary state = new() { ["__default__:old"] = "\"val\"" }; @@ -326,7 +326,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task ReadStateKeysAsync_WithNamedScope_OnlyReturnsKeysFromThatScope() + public async Task ReadStateKeysAsync_WithNamedScope_OnlyReturnsKeysFromThatScopeAsync() { // Arrange Dictionary state = new() @@ -349,7 +349,7 @@ public sealed class DurableWorkflowContextTests #region AddEventAsync [Fact] - public async Task AddEventAsync_AddsEventToCollection() + public async Task AddEventAsync_AddsEventToCollectionAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -364,7 +364,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task AddEventAsync_NullEvent_DoesNotAdd() + public async Task AddEventAsync_NullEvent_DoesNotAddAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -383,7 +383,7 @@ public sealed class DurableWorkflowContextTests #region SendMessageAsync [Fact] - public async Task SendMessageAsync_SerializesMessageWithTypeName() + public async Task SendMessageAsync_SerializesMessageWithTypeNameAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -398,7 +398,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task SendMessageAsync_NullMessage_DoesNotAdd() + public async Task SendMessageAsync_NullMessage_DoesNotAddAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -417,7 +417,7 @@ public sealed class DurableWorkflowContextTests #region YieldOutputAsync [Fact] - public async Task YieldOutputAsync_AddsWorkflowOutputEvent() + public async Task YieldOutputAsync_AddsWorkflowOutputEventAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -432,7 +432,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task YieldOutputAsync_NullOutput_DoesNotAdd() + public async Task YieldOutputAsync_NullOutput_DoesNotAddAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -451,7 +451,7 @@ public sealed class DurableWorkflowContextTests #region RequestHaltAsync [Fact] - public async Task RequestHaltAsync_SetsHaltRequestedAndAddsEvent() + public async Task RequestHaltAsync_SetsHaltRequestedAndAddsEventAsync() { // Arrange DurableWorkflowContext context = new(null, CreateTestExecutor()); @@ -490,7 +490,7 @@ public sealed class DurableWorkflowContextTests } [Fact] - public async Task Constructor_NullInitialState_CreatesEmptyState() + public async Task Constructor_NullInitialState_CreatesEmptyStateAsync() { // Arrange & Act DurableWorkflowContext context = new(null, CreateTestExecutor()); diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs index a3729a27ee..dd6e6548b6 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Diagnostics; using System.Reflection;