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

Aldaviva / Unfucked / 23378203323

21 Mar 2026 10:59AM UTC coverage: 35.442% (-11.7%) from 47.183%
23378203323

push

github

Aldaviva
Seal all possible classes for allegedly higher performance, since they weren't actually subclassable anyway due to C# not making methods virtual by default. If this change does more harm than good, blame Stephen Toub.

573 of 1629 branches covered (35.17%)

14 of 72 new or added lines in 15 files covered. (19.44%)

488 existing lines in 30 files now uncovered.

975 of 2751 relevant lines covered (35.44%)

162.06 hits per line

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

0.0
/HTTP/Serialization/ByteArrayBodyReader.cs
1
using System.Text;
2
using Unfucked.HTTP.Config;
3

4
namespace Unfucked.HTTP.Serialization;
5

6
public sealed class ByteArrayBodyReader: MessageBodyReader {
7

UNCOV
8
    public bool CanRead<T>(string? mimeType, string? bodyPrefix) => typeof(T) == typeof(byte[]);
×
9

10
    public async Task<T> Read<T>(HttpContent responseBody, Encoding? responseEncoding, Configurable? clientConfig, CancellationToken cancellationToken) =>
11
        (T) (object) await ReadByteArray(responseBody, cancellationToken).ConfigureAwait(false);
×
12

13
    private static Task<byte[]> ReadByteArray(HttpContent responseBody, CancellationToken cancellationToken) =>
14
#if NET6_0_OR_GREATER
UNCOV
15
        responseBody.ReadAsByteArrayAsync(cancellationToken);
×
16
#else
17
        responseBody.ReadAsByteArrayAsync();
18
#endif
19

20
    public sealed class MemoryBodyReader: MessageBodyReader {
21

UNCOV
22
        public bool CanRead<T>(string? mimeType, string? bodyPrefix) => typeof(T) == typeof(Memory<byte>);
×
23

24
        public async Task<T> Read<T>(HttpContent responseBody, Encoding? responseEncoding, Configurable? clientConfig, CancellationToken cancellationToken) =>
25
            (T) (object) (await ReadByteArray(responseBody, cancellationToken).ConfigureAwait(false)).AsMemory();
×
26

27
    }
28

29
    public sealed class ReadOnlyMemoryBodyReader: MessageBodyReader {
30

UNCOV
31
        public bool CanRead<T>(string? mimeType, string? bodyPrefix) => typeof(T) == typeof(ReadOnlyMemory<byte>);
×
32

33
        public async Task<T> Read<T>(HttpContent responseBody, Encoding? responseEncoding, Configurable? clientConfig, CancellationToken cancellationToken) =>
34
            (T) (object) new ReadOnlyMemory<byte>(await ReadByteArray(responseBody, cancellationToken).ConfigureAwait(false));
×
35

36
    }
37

38
}
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