Remove unused test cases and workflows from SetOutputTests to simplify integration test coverage.
This commit is contained in:
parent
8a61fa4045
commit
d32134a671
|
|
@ -15,26 +15,10 @@ public class SetOutputTests
|
|||
{
|
||||
_services = new TestApplicationBuilder(testOutputHelper)
|
||||
.WithCapturingTextWriter(_capturingTextWriter)
|
||||
.AddWorkflow<BasicWorkflowOutputWorkflow>()
|
||||
.AddWorkflow<MultipleOutputsWorkflow>()
|
||||
.AddWorkflow<DynamicOutputValueWorkflow>()
|
||||
.Build();
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "SetOutput sets workflow execution context output")]
|
||||
public async Task SetOutput_Should_Set_Workflow_Output()
|
||||
{
|
||||
// Arrange
|
||||
await _services.PopulateRegistriesAsync();
|
||||
|
||||
// Act
|
||||
var workflowState = await _services.RunWorkflowUntilEndAsync<BasicWorkflowOutputWorkflow>();
|
||||
|
||||
// Assert
|
||||
Assert.Contains("Message", workflowState.Output.Keys);
|
||||
Assert.Equal("Hello, World!", workflowState.Output["Message"]);
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "SetOutput can set multiple outputs")]
|
||||
public async Task SetOutput_Should_Set_Multiple_Outputs()
|
||||
{
|
||||
|
|
@ -53,40 +37,9 @@ public class SetOutputTests
|
|||
Assert.Equal("Doe", workflowState.Output["LastName"]);
|
||||
Assert.Equal(30, workflowState.Output["Age"]);
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "SetOutput handles dynamic output values")]
|
||||
public async Task SetOutput_Should_Handle_Dynamic_Values()
|
||||
{
|
||||
// Arrange
|
||||
await _services.PopulateRegistriesAsync();
|
||||
|
||||
// Act
|
||||
var workflowState = await _services.RunWorkflowUntilEndAsync<DynamicOutputValueWorkflow>();
|
||||
|
||||
// Assert
|
||||
Assert.Contains("Greeting", workflowState.Output.Keys);
|
||||
var greeting = workflowState.Output["Greeting"] as string;
|
||||
Assert.NotNull(greeting);
|
||||
Assert.StartsWith("Hello at ", greeting);
|
||||
}
|
||||
}
|
||||
|
||||
// Test Workflows
|
||||
|
||||
/// <summary>
|
||||
/// Basic workflow that uses SetOutput to set a workflow output
|
||||
/// </summary>
|
||||
public class BasicWorkflowOutputWorkflow : WorkflowBase
|
||||
{
|
||||
protected override void Build(IWorkflowBuilder workflow)
|
||||
{
|
||||
workflow.Root = new SetOutput
|
||||
{
|
||||
OutputName = new("Message"),
|
||||
OutputValue = new("Hello, World!")
|
||||
};
|
||||
}
|
||||
}
|
||||
// Test Workflow
|
||||
|
||||
/// <summary>
|
||||
/// Workflow that sets multiple outputs using SetOutput
|
||||
|
|
@ -117,19 +70,4 @@ public class MultipleOutputsWorkflow : WorkflowBase
|
|||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Workflow that uses dynamic values with SetOutput
|
||||
/// </summary>
|
||||
public class DynamicOutputValueWorkflow : WorkflowBase
|
||||
{
|
||||
protected override void Build(IWorkflowBuilder workflow)
|
||||
{
|
||||
workflow.Root = new SetOutput
|
||||
{
|
||||
OutputName = new("Greeting"),
|
||||
OutputValue = new(context => $"Hello at {DateTime.UtcNow:yyyy-MM-dd HH:mm}")
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue