elsa-core/test/integration/Elsa.Core.IntegrationTests/Autofixture/TestingElsaOptionsBuilderExtensions.cs
Craig Fowler 4873aac316 Resolve #748 - Test coverage for EF Db Contexts
As well as providing a unit test which matches other persistence
provider tests (round-tripping a workflow instance), two other tests
are included here:

* When using the default DI registration extension method, this sets
  up pooling of DB contexts and so a resolved context will come from
  the pool.

* When using the non-pooled DI registration extension method, this
  sets up EF without pooling, which is more useful in a multi-tenanted
  environment.

There are also some other changes in this commit corresponding to
improving the tests.  Mainly de-duplicating logic & improving names.
2021-03-13 15:21:44 +00:00

20 lines
717 B
C#

using Elsa.Activities.UserTask.Activities;
using Elsa.Core.IntegrationTests.Workflows;
namespace Elsa.Core.IntegrationTests.Autofixture
{
public static class TestingElsaOptionsExtensions
{
/// <summary>
/// Adds the minimal activities and workflow applicable to running the <see cref="PersistableWorkflow"/>.
/// </summary>
/// <param name="elsa">An elsa options</param>
/// <returns>The same else options, so calls may be chained</returns>
public static ElsaOptions AddPersistableWorkflow(this ElsaOptions elsa)
{
elsa.AddActivity<UserTask>();
elsa.AddWorkflow<PersistableWorkflow>();
return elsa;
}
}
}