- Introduced three test workflows: - `StartInFlowchartAsExplicitStartWorkflow`: Verifies the explicit `Start` activity in a flowchart as a starting point. - `StartInFlowchartWithStartPropertyWorkflow`: Confirms precedence of `Flowchart.Start` property over the `Start` activity. - `StartInSequenceWorkflow`: Demonstrates successful `Start` activity usage in a sequence. - Added integration tests (`StartTests`) ensuring expected execution flows and `Start` activity behavior for each workflow. - Added unit tests validating `Start` activity implementation and compliance with `IStartNode`. - Ensures test coverage for `Start` activity behavior across flowchart, sequence, and property overrides.
36 lines
887 B
C#
36 lines
887 B
C#
using Elsa.Testing.Shared;
|
|
using Elsa.Workflows;
|
|
using Elsa.Workflows.Activities;
|
|
|
|
namespace Elsa.Activities.UnitTests.Flow;
|
|
|
|
/// <summary>
|
|
/// Unit tests for the <see cref="Start"/> activity.
|
|
/// </summary>
|
|
public class StartTests
|
|
{
|
|
[Fact(DisplayName = "Start implements IStartNode interface")]
|
|
public void Start_ImplementsIStartNode()
|
|
{
|
|
// Arrange
|
|
var startActivity = new Start();
|
|
|
|
// Assert
|
|
Assert.IsAssignableFrom<IStartNode>(startActivity);
|
|
}
|
|
|
|
[Fact(DisplayName = "Start completes execution")]
|
|
public async Task Start_CompletesExecution()
|
|
{
|
|
// Arrange
|
|
var startActivity = new Start();
|
|
var fixture = new ActivityTestFixture(startActivity);
|
|
|
|
// Act
|
|
var context = await fixture.ExecuteAsync();
|
|
|
|
// Assert
|
|
Assert.Equal(ActivityStatus.Completed, context.Status);
|
|
}
|
|
}
|