* Add unit and integration tests for `Complete` activity to validate composite workflows execution - Introduced integration and unit tests covering `Complete` activity behavior in nested and simple composite workflows. - Added `CompleteTests` for edge cases such as immediate parent completion and composite termination. - Developed new composite activities (`InnerComposite`, `OuterComposite`, `SimpleComposite`) for testing scenarios. * Remove unnecessary `Complete` constructors tests.
35 lines
906 B
C#
35 lines
906 B
C#
using Elsa.Testing.Shared;
|
|
using Elsa.Workflows;
|
|
|
|
namespace Elsa.Activities.UnitTests.Composition;
|
|
|
|
/// <summary>
|
|
/// Unit tests for the <see cref="Complete"/> activity.
|
|
/// </summary>
|
|
public class CompleteTests
|
|
{
|
|
[Fact(DisplayName = "Complete implements ITerminalNode interface")]
|
|
public void Complete_ImplementsITerminalNode()
|
|
{
|
|
// Arrange
|
|
var completeActivity = new Complete();
|
|
|
|
// Assert
|
|
Assert.IsAssignableFrom<ITerminalNode>(completeActivity);
|
|
}
|
|
|
|
[Fact(DisplayName = "Complete completes execution")]
|
|
public async Task Complete_CompletesExecution()
|
|
{
|
|
// Arrange
|
|
var completeActivity = new Complete();
|
|
var fixture = new ActivityTestFixture(completeActivity);
|
|
|
|
// Act
|
|
var context = await fixture.ExecuteAsync();
|
|
|
|
// Assert
|
|
Assert.Equal(ActivityStatus.Completed, context.Status);
|
|
}
|
|
}
|