elsa-core/test/component/Elsa.ComponentTests/Helpers/ElsaClientTestBase.cs

17 lines
637 B
C#
Raw Normal View History

2020-11-13 19:47:08 +00:00
using Elsa.Client;
using Elsa.Client.Extensions;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.ComponentTests.Helpers
{
public abstract class ElsaClientTestBase : TestBase
{
protected ElsaClientTestBase(ElsaHostApplicationFactory hostApplicationFactory) : base(hostApplicationFactory)
{
var services = new ServiceCollection().AddElsaClient(options => options.ServerUrl = HttpClient.BaseAddress!, () => HttpClient).BuildServiceProvider();
ElsaClient = services.GetRequiredService<IElsaClient>();
}
protected IElsaClient ElsaClient { get; }
}
}