Files
agent-framework/dotnet/tests/Microsoft.Agents.Workflows.Declarative.UnitTests/WorkflowTest.cs
T
Chris e11ec9d941 .NET Workflows - Declarative Workflow Integration Tests (#956)
* Checkpoint / 100% Pass

* Checkpoint: ActionExecutorResult

* Update dotnet/tests/Microsoft.Agents.Workflows.Declarative.IntegrationTests/Testcases/Marketing.json

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Namespace

* Sync updates

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-29 16:40:15 +00:00

51 lines
1.3 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
using System;
using Microsoft.Agents.Workflows.Declarative.PowerFx;
using Microsoft.Bot.ObjectModel;
using Xunit.Abstractions;
namespace Microsoft.Agents.Workflows.Declarative.UnitTests;
/// <summary>
/// Base class for workflow tests.
/// </summary>
public abstract class WorkflowTest : IDisposable
{
public TestOutputAdapter Output { get; }
protected WorkflowTest(ITestOutputHelper output)
{
this.Output = new TestOutputAdapter(output);
Console.SetOut(this.Output);
SetProduct();
}
public void Dispose()
{
this.Dispose(isDisposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool isDisposing)
{
if (isDisposing)
{
this.Output.Dispose();
}
}
protected static void SetProduct()
{
if (!ProductContext.IsLocalScopeSupported())
{
ProductContext.SetContext(Product.Foundry);
}
}
internal static string? FormatOptionalPath(string? variableName, string? scope = null) =>
variableName is null ? null : FormatVariablePath(variableName, scope);
internal static string FormatVariablePath(string variableName, string? scope = null) => $"{scope ?? WorkflowFormulaState.DefaultScopeName}.{variableName}";
}