elsa-core/test/integration/Elsa.Core.IntegrationTests/Autofixture/WithMongoDbAttribute.cs
Craig Fowler d285b8b505 WIP composing customize attributes
This isn't really related to #751 - it's a refactor of some of
our test logic, to avoid bloat of semi-repeated autofixture
customization attributes.

By switching to a behaviour-driven model, it's possible to
compose them, which means that there's no need to part-duplicate
between them.  It should also reduce the overall number of them,
as combinations can be put together on-demand, rather than needing
a new attribute of their own.
2021-04-02 11:12:21 +01:00

22 lines
731 B
C#

using System;
using Elsa.Persistence.MongoDb.Extensions;
using Elsa.Testing.Shared.AutoFixture.Attributes;
using Elsa.Testing.Shared.Helpers;
namespace Elsa.Core.IntegrationTests.Autofixture
{
public class WithMongoDbAttribute : ElsaHostBuilderBuilderCustomizeAttributeBase
{
public override Action<ElsaHostBuilderBuilder> GetBuilderCustomizer()
{
return builder => {
builder.ElsaCallbacks.Add(elsa => {
elsa.UseMongoDbPersistence(opts => {
opts.ConnectionString = "mongodb://localhost:27017";
opts.DatabaseName = "IntegrationTests";
});
});
};
}
}
}