mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Enable more analyzers and various code tweaks/cleanup (#738)
This commit is contained in:
committed by
GitHub
Unverified
parent
f3264966ff
commit
5e5761b288
+9
-11
@@ -14,40 +14,40 @@ namespace Microsoft.Agents.Workflows.Declarative.UnitTests.ObjectModel;
|
||||
public sealed class ClearAllVariablesExecutorTest(ITestOutputHelper output) : WorkflowActionExecutorTest(output)
|
||||
{
|
||||
[Fact]
|
||||
public async Task ClearWorkflowScope()
|
||||
public async Task ClearWorkflowScopeAsync()
|
||||
{
|
||||
// Arrange
|
||||
this.State.Set("NoVar", FormulaValue.New("Old value"));
|
||||
|
||||
ClearAllVariables model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(ClearWorkflowScope)),
|
||||
this.FormatDisplayName(nameof(ClearWorkflowScopeAsync)),
|
||||
VariablesToClear.ConversationScopedVariables);
|
||||
|
||||
// Act
|
||||
ClearAllVariablesExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyUndefined("NoVar");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ClearUndefinedScope()
|
||||
public async Task ClearUndefinedScopeAsync()
|
||||
{
|
||||
// Arrange
|
||||
ClearAllVariables model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(ClearUndefinedScope)),
|
||||
this.FormatDisplayName(nameof(ClearUndefinedScopeAsync)),
|
||||
VariablesToClear.UserScopedVariables);
|
||||
|
||||
// Act
|
||||
ClearAllVariablesExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyUndefined("NoVar");
|
||||
}
|
||||
|
||||
@@ -61,8 +61,6 @@ public sealed class ClearAllVariablesExecutorTest(ITestOutputHelper output) : Wo
|
||||
Variables = EnumExpression<VariablesToClearWrapper>.Literal(VariablesToClearWrapper.Get(variableTarget)),
|
||||
};
|
||||
|
||||
ClearAllVariables model = this.AssignParent<ClearAllVariables>(actionBuilder);
|
||||
|
||||
return model;
|
||||
return AssignParent<ClearAllVariables>(actionBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
+17
-19
@@ -14,7 +14,7 @@ namespace Microsoft.Agents.Workflows.Declarative.UnitTests.ObjectModel;
|
||||
public sealed class ParseValueExecutorTest(ITestOutputHelper output) : WorkflowActionExecutorTest(output)
|
||||
{
|
||||
[Fact]
|
||||
public async Task ParseTable()
|
||||
public async Task ParseTableAsync()
|
||||
{
|
||||
// Arrange
|
||||
RecordDataType.Builder recordBuilder =
|
||||
@@ -27,73 +27,73 @@ public sealed class ParseValueExecutorTest(ITestOutputHelper output) : WorkflowA
|
||||
};
|
||||
ParseValue model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(ParseTable)),
|
||||
this.FormatDisplayName(nameof(ParseTableAsync)),
|
||||
recordBuilder,
|
||||
@"{ ""key1"": ""val1"" }");
|
||||
|
||||
// Act
|
||||
ParseValueExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyState("Target", FormulaValue.NewRecordFromFields(new NamedValue("key1", FormulaValue.New("val1"))));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ParseBoolean()
|
||||
public async Task ParseBooleanAsync()
|
||||
{
|
||||
// Arrange
|
||||
ParseValue model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(ParseTable)),
|
||||
this.FormatDisplayName(nameof(ParseTableAsync)),
|
||||
new BooleanDataType.Builder(),
|
||||
"True");
|
||||
|
||||
// Act
|
||||
ParseValueExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyState("Target", FormulaValue.New(true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ParseNumber()
|
||||
public async Task ParseNumberAsync()
|
||||
{
|
||||
// Arrange
|
||||
ParseValue model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(ParseNumber)),
|
||||
this.FormatDisplayName(nameof(ParseNumberAsync)),
|
||||
new NumberDataType.Builder(),
|
||||
"42");
|
||||
|
||||
// Act
|
||||
ParseValueExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyState("Target", FormulaValue.New(42));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ParseString()
|
||||
public async Task ParseStringAsync()
|
||||
{
|
||||
// Arrange
|
||||
ParseValue model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(ParseString)),
|
||||
this.FormatDisplayName(nameof(ParseStringAsync)),
|
||||
new StringDataType.Builder(),
|
||||
"Hello, World!");
|
||||
|
||||
// Act
|
||||
ParseValueExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyState("Target", FormulaValue.New("Hello, World!"));
|
||||
}
|
||||
|
||||
@@ -109,8 +109,6 @@ public sealed class ParseValueExecutorTest(ITestOutputHelper output) : WorkflowA
|
||||
Value = new ValueExpression.Builder(ValueExpression.Literal(StringDataValue.Create(sourceText))),
|
||||
};
|
||||
|
||||
ParseValue model = this.AssignParent<ParseValue>(actionBuilder);
|
||||
|
||||
return model;
|
||||
return AssignParent<ParseValue>(actionBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-11
@@ -14,7 +14,7 @@ namespace Microsoft.Agents.Workflows.Declarative.UnitTests.ObjectModel;
|
||||
public sealed class ResetVariableExecutorTest(ITestOutputHelper output) : WorkflowActionExecutorTest(output)
|
||||
{
|
||||
[Fact]
|
||||
public async Task ResetDefinedValue()
|
||||
public async Task ResetDefinedValueAsync()
|
||||
{
|
||||
// Arrange
|
||||
this.State.Set("MyVar1", FormulaValue.New("Value #1"));
|
||||
@@ -22,36 +22,36 @@ public sealed class ResetVariableExecutorTest(ITestOutputHelper output) : Workfl
|
||||
|
||||
ResetVariable model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(ResetDefinedValue)),
|
||||
this.FormatDisplayName(nameof(ResetDefinedValueAsync)),
|
||||
FormatVariablePath("MyVar1"));
|
||||
|
||||
// Act
|
||||
ResetVariableExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyUndefined("MyVar1");
|
||||
this.VerifyState("MyVar2", FormulaValue.New("Value #2"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ResetUndefinedValue()
|
||||
public async Task ResetUndefinedValueAsync()
|
||||
{
|
||||
// Arrange
|
||||
this.State.Set("MyVar1", FormulaValue.New("Value #1"));
|
||||
|
||||
ResetVariable model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(ResetUndefinedValue)),
|
||||
this.FormatDisplayName(nameof(ResetUndefinedValueAsync)),
|
||||
FormatVariablePath("NoVar"));
|
||||
|
||||
// Act
|
||||
ResetVariableExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyUndefined("NoVar");
|
||||
this.VerifyState("MyVar1", FormulaValue.New("Value #1"));
|
||||
}
|
||||
@@ -66,8 +66,6 @@ public sealed class ResetVariableExecutorTest(ITestOutputHelper output) : Workfl
|
||||
Variable = InitializablePropertyPath.Create(variablePath),
|
||||
};
|
||||
|
||||
ResetVariable model = this.AssignParent<ResetVariable>(actionBuilder);
|
||||
|
||||
return model;
|
||||
return AssignParent<ResetVariable>(actionBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-7
@@ -13,20 +13,20 @@ namespace Microsoft.Agents.Workflows.Declarative.UnitTests.ObjectModel;
|
||||
public sealed class SendActivityExecutorTest(ITestOutputHelper output) : WorkflowActionExecutorTest(output)
|
||||
{
|
||||
[Fact]
|
||||
public async Task CaptureActivity()
|
||||
public async Task CaptureActivityAsync()
|
||||
{
|
||||
// Arrange
|
||||
SendActivity model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(CaptureActivity)),
|
||||
this.FormatDisplayName(nameof(CaptureActivityAsync)),
|
||||
"Test activity message");
|
||||
|
||||
// Act
|
||||
SendActivityExecutor action = new(model, this.State);
|
||||
WorkflowEvent[] events = await this.Execute(action);
|
||||
WorkflowEvent[] events = await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
Assert.Contains(events, e => e is MessageActivityEvent);
|
||||
}
|
||||
|
||||
@@ -46,8 +46,6 @@ public sealed class SendActivityExecutorTest(ITestOutputHelper output) : Workflo
|
||||
Activity = activityBuilder.Build(),
|
||||
};
|
||||
|
||||
SendActivity model = this.AssignParent<SendActivity>(actionBuilder);
|
||||
|
||||
return model;
|
||||
return AssignParent<SendActivity>(actionBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-11
@@ -14,42 +14,42 @@ namespace Microsoft.Agents.Workflows.Declarative.UnitTests.ObjectModel;
|
||||
public sealed class SetTextVariableExecutorTest(ITestOutputHelper output) : WorkflowActionExecutorTest(output)
|
||||
{
|
||||
[Fact]
|
||||
public async Task SetLiteralValue()
|
||||
public async Task SetLiteralValueAsync()
|
||||
{
|
||||
// Arrange
|
||||
SetTextVariable model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(SetLiteralValue)),
|
||||
this.FormatDisplayName(nameof(SetLiteralValueAsync)),
|
||||
FormatVariablePath("TextVar"),
|
||||
"Text variable value");
|
||||
|
||||
// Act
|
||||
SetTextVariableExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyState("TextVar", FormulaValue.New("Text variable value"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UpdateExistingValue()
|
||||
public async Task UpdateExistingValueAsync()
|
||||
{
|
||||
// Arrange
|
||||
this.State.Set("TextVar", FormulaValue.New("Old value"));
|
||||
|
||||
SetTextVariable model =
|
||||
this.CreateModel(
|
||||
this.FormatDisplayName(nameof(UpdateExistingValue)),
|
||||
this.FormatDisplayName(nameof(UpdateExistingValueAsync)),
|
||||
FormatVariablePath("TextVar"),
|
||||
"New value");
|
||||
|
||||
// Act
|
||||
SetTextVariableExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyState("TextVar", FormulaValue.New("New value"));
|
||||
}
|
||||
|
||||
@@ -64,8 +64,6 @@ public sealed class SetTextVariableExecutorTest(ITestOutputHelper output) : Work
|
||||
Value = TemplateLine.Parse(textValue),
|
||||
};
|
||||
|
||||
SetTextVariable model = this.AssignParent<SetTextVariable>(actionBuilder);
|
||||
|
||||
return model;
|
||||
return AssignParent<SetTextVariable>(actionBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
+37
-47
@@ -14,147 +14,139 @@ namespace Microsoft.Agents.Workflows.Declarative.UnitTests.ObjectModel;
|
||||
public sealed class SetVariableExecutorTest(ITestOutputHelper output) : WorkflowActionExecutorTest(output)
|
||||
{
|
||||
[Fact]
|
||||
public void InvalidModel()
|
||||
{
|
||||
public void InvalidModel() =>
|
||||
// Arrange, Act, Assert
|
||||
Assert.Throws<DeclarativeModelException>(() => new SetVariableExecutor(new SetVariable(), this.State));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetNumericValue()
|
||||
{
|
||||
public async Task SetNumericValueAsync() =>
|
||||
// Arrange, Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetNumericValue),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetNumericValueAsync),
|
||||
variableName: "TestVariable",
|
||||
variableValue: new NumberDataValue(42),
|
||||
expectedValue: FormulaValue.New(42));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetStringValue()
|
||||
{
|
||||
public async Task SetStringValueAsync() =>
|
||||
// Arrange, Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetStringValue),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetStringValueAsync),
|
||||
variableName: "TestVariable",
|
||||
variableValue: new StringDataValue("Text"),
|
||||
expectedValue: FormulaValue.New("Text"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetBooleanValue()
|
||||
{
|
||||
public async Task SetBooleanValueAsync() =>
|
||||
// Arrange, Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetBooleanValue),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetBooleanValueAsync),
|
||||
variableName: "TestVariable",
|
||||
variableValue: new BooleanDataValue(true),
|
||||
expectedValue: FormulaValue.New(true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetBooleanExpression()
|
||||
public async Task SetBooleanExpressionAsync()
|
||||
{
|
||||
// Arrange
|
||||
ValueExpression.Builder expressionBuilder = new(ValueExpression.Expression("true || false"));
|
||||
|
||||
// Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetBooleanExpression),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetBooleanExpressionAsync),
|
||||
variableName: "TestVariable",
|
||||
valueExpression: expressionBuilder,
|
||||
expectedValue: FormulaValue.New(true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetNumberExpression()
|
||||
public async Task SetNumberExpressionAsync()
|
||||
{
|
||||
// Arrange
|
||||
ValueExpression.Builder expressionBuilder = new(ValueExpression.Expression("9 - 3"));
|
||||
|
||||
// Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetBooleanExpression),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetBooleanExpressionAsync),
|
||||
variableName: "TestVariable",
|
||||
valueExpression: expressionBuilder,
|
||||
expectedValue: FormulaValue.New(6));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetStringExpression()
|
||||
public async Task SetStringExpressionAsync()
|
||||
{
|
||||
// Arrange
|
||||
ValueExpression.Builder expressionBuilder = new(ValueExpression.Expression(@"Concatenate(""A"", ""B"", ""C"")"));
|
||||
|
||||
// Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetBooleanExpression),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetBooleanExpressionAsync),
|
||||
variableName: "TestVariable",
|
||||
valueExpression: expressionBuilder,
|
||||
expectedValue: FormulaValue.New("ABC"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetBooleanVariable()
|
||||
public async Task SetBooleanVariableAsync()
|
||||
{
|
||||
// Arrange
|
||||
this.State.Set("Source", FormulaValue.New(true));
|
||||
ValueExpression.Builder expressionBuilder = new(ValueExpression.Variable(PropertyPath.TopicVariable("Source")));
|
||||
|
||||
// Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetBooleanExpression),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetBooleanExpressionAsync),
|
||||
variableName: "TestVariable",
|
||||
valueExpression: expressionBuilder,
|
||||
expectedValue: FormulaValue.New(true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetNumberVariable()
|
||||
public async Task SetNumberVariableAsync()
|
||||
{
|
||||
// Arrange
|
||||
this.State.Set("Source", FormulaValue.New(321));
|
||||
ValueExpression.Builder expressionBuilder = new(ValueExpression.Variable(PropertyPath.TopicVariable("Source")));
|
||||
|
||||
// Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetBooleanExpression),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetBooleanExpressionAsync),
|
||||
variableName: "TestVariable",
|
||||
valueExpression: expressionBuilder,
|
||||
expectedValue: FormulaValue.New(321));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SetStringVariable()
|
||||
public async Task SetStringVariableAsync()
|
||||
{
|
||||
// Arrange
|
||||
this.State.Set("Source", FormulaValue.New("Test"));
|
||||
ValueExpression.Builder expressionBuilder = new(ValueExpression.Variable(PropertyPath.TopicVariable("Source")));
|
||||
|
||||
// Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(SetBooleanExpression),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(SetBooleanExpressionAsync),
|
||||
variableName: "TestVariable",
|
||||
valueExpression: expressionBuilder,
|
||||
expectedValue: FormulaValue.New("Test"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UpdateExistingValue()
|
||||
public async Task UpdateExistingValueAsync()
|
||||
{
|
||||
// Arrange
|
||||
this.State.Set("VarA", FormulaValue.New(33));
|
||||
|
||||
// Act, Assert
|
||||
await this.ExecuteTest(
|
||||
displayName: nameof(UpdateExistingValue),
|
||||
await this.ExecuteTestAsync(
|
||||
displayName: nameof(UpdateExistingValueAsync),
|
||||
variableName: "VarA",
|
||||
variableValue: new NumberDataValue(42),
|
||||
expectedValue: FormulaValue.New(42));
|
||||
}
|
||||
|
||||
private Task ExecuteTest(
|
||||
private Task ExecuteTestAsync(
|
||||
string displayName,
|
||||
string variableName,
|
||||
DataValue variableValue,
|
||||
@@ -164,10 +156,10 @@ public sealed class SetVariableExecutorTest(ITestOutputHelper output) : Workflow
|
||||
ValueExpression.Builder expressionBuilder = new(ValueExpression.Literal(variableValue));
|
||||
|
||||
// Act & Assert
|
||||
return this.ExecuteTest(displayName, variableName, expressionBuilder, expectedValue);
|
||||
return this.ExecuteTestAsync(displayName, variableName, expressionBuilder, expectedValue);
|
||||
}
|
||||
|
||||
private async Task ExecuteTest(
|
||||
private async Task ExecuteTestAsync(
|
||||
string displayName,
|
||||
string variableName,
|
||||
ValueExpression.Builder valueExpression,
|
||||
@@ -184,10 +176,10 @@ public sealed class SetVariableExecutorTest(ITestOutputHelper output) : Workflow
|
||||
|
||||
// Act
|
||||
SetVariableExecutor action = new(model, this.State);
|
||||
await this.Execute(action);
|
||||
await this.ExecuteAsync(action);
|
||||
|
||||
// Assert
|
||||
this.VerifyModel(model, action);
|
||||
VerifyModel(model, action);
|
||||
this.VerifyState(variableName, expectedValue);
|
||||
}
|
||||
|
||||
@@ -202,8 +194,6 @@ public sealed class SetVariableExecutorTest(ITestOutputHelper output) : Workflow
|
||||
Value = valueExpression,
|
||||
};
|
||||
|
||||
SetVariable model = this.AssignParent<SetVariable>(actionBuilder);
|
||||
|
||||
return model;
|
||||
return AssignParent<SetVariable>(actionBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-9
@@ -24,7 +24,7 @@ public abstract class WorkflowActionExecutorTest(ITestOutputHelper output) : Wor
|
||||
|
||||
protected string FormatDisplayName(string name) => $"{this.GetType().Name}_{name}";
|
||||
|
||||
internal async Task<WorkflowEvent[]> Execute(DeclarativeActionExecutor executor)
|
||||
internal async Task<WorkflowEvent[]> ExecuteAsync(DeclarativeActionExecutor executor)
|
||||
{
|
||||
TestWorkflowExecutor workflowExecutor = new();
|
||||
WorkflowBuilder workflowBuilder = new(workflowExecutor);
|
||||
@@ -36,7 +36,7 @@ public abstract class WorkflowActionExecutorTest(ITestOutputHelper output) : Wor
|
||||
return events;
|
||||
}
|
||||
|
||||
internal void VerifyModel(DialogAction model, DeclarativeActionExecutor action)
|
||||
internal static void VerifyModel(DialogAction model, DeclarativeActionExecutor action)
|
||||
{
|
||||
Assert.Equal(model.Id, action.Id);
|
||||
Assert.Equal(model, action.Model);
|
||||
@@ -52,12 +52,10 @@ public abstract class WorkflowActionExecutorTest(ITestOutputHelper output) : Wor
|
||||
|
||||
protected void VerifyUndefined(string variableName) => this.VerifyUndefined(variableName, VariableScopeNames.Topic);
|
||||
|
||||
internal void VerifyUndefined(string variableName, string scopeName)
|
||||
{
|
||||
internal void VerifyUndefined(string variableName, string scopeName) =>
|
||||
Assert.IsType<BlankValue>(this.State.Get(variableName, scopeName));
|
||||
}
|
||||
|
||||
protected TAction AssignParent<TAction>(DialogAction.Builder actionBuilder) where TAction : DialogAction
|
||||
protected static TAction AssignParent<TAction>(DialogAction.Builder actionBuilder) where TAction : DialogAction
|
||||
{
|
||||
OnActivity.Builder activityBuilder =
|
||||
new()
|
||||
@@ -76,9 +74,7 @@ public abstract class WorkflowActionExecutorTest(ITestOutputHelper output) : Wor
|
||||
ReflectingExecutor<TestWorkflowExecutor>(nameof(TestWorkflowExecutor)),
|
||||
IMessageHandler<WorkflowFormulaState>
|
||||
{
|
||||
public async ValueTask HandleAsync(WorkflowFormulaState message, IWorkflowContext context)
|
||||
{
|
||||
public async ValueTask HandleAsync(WorkflowFormulaState message, IWorkflowContext context) =>
|
||||
await context.SendMessageAsync(new ExecutorResultMessage(this.Id)).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user