elsa-core/test/unit/Elsa.UnitTests/Services/WorkflowBuilderTests.cs
Craig Fowler 8751bead5a WIP #728 - Make WorkflowBurst default behaviour
In the comments to #728 it was suggested that
WorkflowBurst persistence behaviour was a more
sane default.
2021-03-09 19:57:45 +00:00

29 lines
1.2 KiB
C#

using System;
using AutoFixture.Xunit2;
using Elsa.Builders;
using Elsa.Models;
using Elsa.Testing.Shared.AutoFixture.Attributes;
using Xunit;
namespace Elsa.Services
{
public class WorkflowBuilderTests
{
[Theory(DisplayName = "The Build method should return a workflow blueprint with the WorkflowBurst persistence behaviour if no behaviour was specified"), AutoMoqData]
public void BuildShouldReturnWorkflowBlueprintWithWorkflowBurstPersistenceBehaviourIfNoBehaviourSpecified([AutofixtureServiceProvider, Frozen] IServiceProvider serviceProvider,
WorkflowBuilder sut,
string idPrefix)
{
var workflow = new NoOpWorkflow();
var blueprint = sut.Build(workflow, idPrefix);
Assert.Equal(WorkflowPersistenceBehavior.WorkflowBurst, blueprint.PersistenceBehavior);
}
class NoOpWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder) { }
}
}
}