< Summary

Information
Class: Elsa.Http.Services.DefaultHttpEndpointBasePathProvider
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Services/DefaultHttpEndpointBasePathProvider.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 18
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
GetBasePath()50%22100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Services/DefaultHttpEndpointBasePathProvider.cs

#LineLine coverage
 1using Elsa.Http.Options;
 2using JetBrains.Annotations;
 3using Microsoft.Extensions.Options;
 4
 5namespace Elsa.Http.Services;
 6
 7[UsedImplicitly]
 11228public class DefaultHttpEndpointBasePathProvider(IOptions<HttpActivityOptions> options) : IHttpEndpointBasePathProvider
 9{
 10    public string GetBasePath()
 11    {
 1012        var baseUrl = new Uri(options.Value.BaseUrl.ToString().TrimEnd('/') + '/');
 1013        var basePath = options.Value.BasePath?.ToString().Trim('/');
 1014        var completeBaseUrl = new Uri(baseUrl, basePath);
 15
 1016        return completeBaseUrl.ToString().TrimEnd('/') + '/';
 17    }
 18}