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.
22 lines
731 B
C#
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";
|
|
});
|
|
});
|
|
};
|
|
}
|
|
}
|
|
} |