< Summary

Information
Class: Elsa.Extensions.TemplateContextExtensions
Assembly: Elsa.Expressions.Liquid
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.Liquid/Extensions/TemplateContextExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 23
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddFilters(...)0%620%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.Liquid/Extensions/TemplateContextExtensions.cs

#LineLine coverage
 1using Elsa.Expressions.Liquid.Contracts;
 2using Elsa.Expressions.Liquid.Options;
 3using Fluid;
 4using Microsoft.Extensions.DependencyInjection;
 5
 6// ReSharper disable once CheckNamespace
 7namespace Elsa.Extensions;
 8
 9internal static class TemplateContextExtensions
 10{
 11    internal static void AddFilters(this TemplateContext templateContext, FluidOptions options, IServiceProvider service
 12    {
 013        foreach (var (key, value) in options.FilterRegistrations)
 14        {
 015            templateContext.Options.Filters.AddFilter(key, (input, arguments, ctx) =>
 016            {
 017                var filter = (ILiquidFilter)services.GetRequiredService(value);
 018                return filter.ProcessAsync(input, arguments, ctx);
 019            });
 20        }
 021        options.ConfigureFilters(templateContext);
 022    }
 23}