< Summary

Information
Class: Elsa.Testing.Shared.Extensions.HttpResponseMessageExtensions
Assembly: Elsa.Testing.Shared.Component
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Testing.Shared.Component/Extensions/HttpResponseMessageExtensions.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 14
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
ReadAsJsonAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Testing.Shared.Component/Extensions/HttpResponseMessageExtensions.cs

#LineLine coverage
 1using System.Text.Json;
 2using Elsa.Api.Client;
 3
 4namespace Elsa.Testing.Shared.Extensions;
 5
 6public static class HttpResponseMessageExtensions
 7{
 8    public static async Task<T> ReadAsJsonAsync<T>(this HttpResponseMessage response, IServiceProvider serviceProvider, 
 9    {
 1110        var json = await response.Content.ReadAsStringAsync(cancellationToken);
 1111        var options = RefitSettingsHelper.CreateJsonSerializerOptions(serviceProvider);
 1112        return JsonSerializer.Deserialize<T>(json, options)!;
 1113    }
 14}

Methods/Properties

ReadAsJsonAsync()