< Summary

Information
Class: Elsa.Http.DownloadableContentHandlers.HttpFileDownloadableContentHandler
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/DownloadableContentHandlers/HttpFileDownloadableContentHandler.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 23
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetSupportsContent(...)100%210%
GetDownloadable(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/DownloadableContentHandlers/HttpFileDownloadableContentHandler.cs

#LineLine coverage
 1using Elsa.Http.Abstractions;
 2using Elsa.Http.Contexts;
 3
 4namespace Elsa.Http.DownloadableContentHandlers;
 5
 6/// <summary>
 7/// Handles content that represents a downloadable stream.
 8/// </summary>
 9public class HttpFileDownloadableContentHandler : DownloadableContentHandlerBase
 10{
 11    /// <inheritdoc />
 012    public override bool GetSupportsContent(object content) => content is HttpFile;
 13
 14    /// <inheritdoc />
 15    protected override Downloadable GetDownloadable(DownloadableContext context)
 16    {
 017        var file = (HttpFile)context.Content;
 018        var stream = file.Stream;
 019        var fileName = file.Filename;
 020        var contentType = file.ContentType;
 021        return new Downloadable(stream, fileName, contentType);
 22    }
 23}