• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alunacjones / LSL.HttpMessageHandlers.Capturing.Dumps / 14

22 Nov 2025 10:38PM UTC coverage: 94.36% (-3.0%) from 97.363%
14

push

appveyor

Alun Jones
and more delegate alternatives

435 of 461 relevant lines covered (94.36%)

8.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/src/LSL.HttpMessageHandlers.Capturing.Dumps/CompoundContentTypeBasedDeserialiser.cs
1
using System.Collections.Generic;
2
using System.Net.Http;
3
using System.Text.Json.Nodes;
4
using System.Threading.Tasks;
5
using Microsoft.Extensions.Logging;
6

7
namespace LSL.HttpMessageHandlers.Capturing.Dumps;
8

9
internal class CompoundContentTypeBasedDeserialiser(ILogger<CompoundContentTypeBasedDeserialiser> logger, ErrorLoggingExecutor errorLoggingExecutor, IEnumerable<IContentTypeBasedDeserialiser> handlers) : IContentTypeBasedDeserialiser
6✔
10
{
11
    public async Task<JsonNode?> Deserialise(HttpContent httpContent)
12
    {
13
        if (httpContent is null) return null;
×
14

15
        foreach (var handler in handlers)
48✔
16
        {
17
            var result = await errorLoggingExecutor.ExecuteAsyncWithErrorHandling(
17✔
18
                () => handler.Deserialise(httpContent),
34✔
19
                e => logger.LogError(e, "An exception was thrown when executing IContentTypeBasedDeserialiser of type {type}", handler.GetType()),
18✔
20
                null)
17✔
21
                .ConfigureAwait(false);
17✔
22

23
            if (result is not null) return result;
25✔
24
        }
25
        
26
        return null;
3✔
27
    }
11✔
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc