public void UseParallelExecution_configures_options(SqsLambdaConfigurator <TestMessage, TestMessageHandler> configurator, int maxDegreeOfParallelism) { configurator.Services.AddLogging().AddOptions(); configurator.UseParallelExecution(maxDegreeOfParallelism); var sp = configurator.Services.BuildServiceProvider(); var options = sp.GetService <IOptions <ParallelSqsExecutionOptions> >(); Assert.That(options?.Value.MaxDegreeOfParallelism, Is.EqualTo(maxDegreeOfParallelism)); }
public void UseParallelExecution_registers_ParallelSqsEventHandler(int?maxDegreeOfParallelism, SqsLambdaConfigurator <TestMessage, TestMessageHandler> configurator) { configurator.Services.AddLogging().AddOptions(); configurator.Services.AddTransient <ISerializer, SystemTextJsonSerializer>(); configurator.UseParallelExecution(maxDegreeOfParallelism); var sp = configurator.Services.BuildServiceProvider(); var handler = sp.GetService <IEventHandler <SQSEvent> >(); Assert.That(handler, Is.InstanceOf <ParallelSqsEventHandler <TestMessage> >()); }