< Summary

Information
Class: Elsa.Http.Parsers.PlainTextHttpContentParser
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Parsers/PlainTextHttpContentParser.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 24
Line coverage: 100%
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%11100%
ReadAsync()100%11100%

File(s)

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

#LineLine coverage
 1using Elsa.Http.Contexts;
 2
 3namespace Elsa.Http.Parsers;
 4
 5/// <summary>
 6/// Reads application/xml and text/xml content type streams.
 7/// </summary>
 8public class PlainTextHttpContentParser : IHttpContentParser
 9{
 10    /// <inheritdoc />
 20611    public int Priority => 0;
 12
 13    /// <inheritdoc />
 20014    public bool GetSupportsContentType(HttpResponseParserContext context) => context.ContentType.Contains("text/plain", 
 15
 16    /// <inheritdoc />
 17    public async Task<object> ReadAsync(HttpResponseParserContext context)
 18    {
 20019        var content = context.Content;
 20020        using var reader = new StreamReader(content, leaveOpen: true);
 20021        var stringContent = await reader.ReadToEndAsync();
 20022        return stringContent;
 20023    }
 24}