* Fix flowchart next activity scheduling bug This fixes a bug where the Flowchart activity would schedule connected activities regardless of the outcome of the completed activity. * Cancel activity execution when cancellation token is triggered. * Enable user to handle HTTP endpoint validation failures as outcomes * Don't respond with full details in case of HTTP Endpoint faults for security
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Elsa.IntegrationTests.Scenarios.FlowchartNextActivity.Workflows;
|
|
using Elsa.Testing.Shared;
|
|
using Elsa.Workflows.Core.Contracts;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Elsa.IntegrationTests.Scenarios.FlowchartNextActivity;
|
|
|
|
public class FlowchartNextActivityTests
|
|
{
|
|
private readonly CapturingTextWriter _capturingTextWriter = new();
|
|
private readonly IServiceProvider _services;
|
|
private readonly IWorkflowRunner _workflowRunner;
|
|
|
|
public FlowchartNextActivityTests(ITestOutputHelper testOutputHelper)
|
|
{
|
|
_services = new TestApplicationBuilder(testOutputHelper)
|
|
.WithCapturingTextWriter(_capturingTextWriter)
|
|
.AddActivitiesFrom<FlowchartNextActivityTests>()
|
|
.Build();
|
|
|
|
_workflowRunner = _services.GetRequiredService<IWorkflowRunner>();
|
|
}
|
|
|
|
[Fact(DisplayName = "Flowchart only schedules next activity connected to outcome of previous activity.")]
|
|
public async Task Test1()
|
|
{
|
|
await _services.PopulateRegistriesAsync();
|
|
await _workflowRunner.RunAsync<FlowchartWorkflow>();
|
|
var lines = _capturingTextWriter.Lines.ToList();
|
|
Assert.Equal(new[] { "Line 1" }, lines);
|
|
}
|
|
} |