elsa-core/test/integration/Elsa.Core.IntegrationTests/WhileWorkflowTests.cs
2020-10-23 14:00:10 +02:00

27 lines
880 B
C#

using System.Linq;
using System.Threading.Tasks;
using Elsa.Core.IntegrationTests.Workflows;
using Elsa.Testing.Shared.Helpers;
using Xunit;
using Xunit.Abstractions;
namespace Elsa.Core.IntegrationTests
{
public class WhileWorkflowTests : WorkflowsUnitTestBase
{
public WhileWorkflowTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
}
[Fact(DisplayName = "Runs loop while condition is true.")]
public async Task Test01()
{
const int loopCount = 3;
var workflow = new WhileWorkflow(loopCount);
var workflowInstance = await WorkflowRunner.RunWorkflowAsync(workflow);
var iterationLogs = workflowInstance.ExecutionLog.Where(x => x.ActivityId == "WriteLoopCount").ToList();
Assert.Equal(loopCount, iterationLogs.Count);
}
}
}