< Summary

Information
Class: Elsa.Http.Parsers.TextHtmlHttpContentParser
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Parsers/TextHtmlHttpContentParser.cs
Line coverage
14%
Covered lines: 1
Uncovered lines: 6
Coverable lines: 7
Total lines: 25
Line coverage: 14.2%
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
get_Priority()100%11100%
GetSupportsContentType(...)100%210%
ReadAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Parsers/TextHtmlHttpContentParser.cs

#LineLine coverage
 1using Elsa.Http.Contexts;
 2
 3namespace Elsa.Http.Parsers;
 4
 5/// <summary>
 6/// Reads text/html content type streams.
 7/// </summary>
 8// TODO: found a library to use a Html Content Parser and use a complexe object Type, until this, this class allow to ac
 9public class TextHtmlHttpContentParser : IHttpContentParser
 10{
 11    /// <inheritdoc />
 20612    public int Priority => 0;
 13
 14    /// <inheritdoc />
 015    public bool GetSupportsContentType(HttpResponseParserContext context) => context.ContentType.Contains("text/html", S
 16
 17    /// <inheritdoc />
 18    public async Task<object> ReadAsync(HttpResponseParserContext context)
 19    {
 020        var content = context.Content;
 021        using var reader = new StreamReader(content, leaveOpen: true);
 022        var stringContent = await reader.ReadToEndAsync();
 023        return stringContent;
 024    }
 25}