2021-03-09 19:52:36 +00:00
using System ;
using AutoFixture.Xunit2 ;
using Elsa.Builders ;
using Elsa.Models ;
2021-04-07 11:00:58 +00:00
using Elsa.Testing.Shared ;
2021-03-09 19:52:36 +00:00
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]
2021-04-02 12:28:27 +00:00
public void BuildShouldReturnWorkflowBlueprintWithWorkflowBurstPersistenceBehaviourIfNoBehaviourSpecified ( [ WithAutofixtureResolution , Frozen ] IServiceProvider serviceProvider ,
2021-04-02 09:26:20 +00:00
IIdGenerator idGenerator ,
2021-05-16 17:20:59 +00:00
IGetsStartActivities getsStartActivities ,
2021-03-30 08:05:50 +00:00
string idPrefix )
2021-03-09 19:52:36 +00:00
{
var workflow = new NoOpWorkflow ( ) ;
2021-05-16 17:20:59 +00:00
var sut = new WorkflowBuilder ( idGenerator , serviceProvider , getsStartActivities ) ;
2021-03-09 19:52:36 +00:00
var blueprint = sut . Build ( workflow , idPrefix ) ;
Assert . Equal ( WorkflowPersistenceBehavior . WorkflowBurst , blueprint . PersistenceBehavior ) ;
}
class NoOpWorkflow : IWorkflow
{
2021-03-30 08:05:50 +00:00
public void Build ( IWorkflowBuilder builder )
{
}
2021-03-09 19:52:36 +00:00
}
}
}