< Summary

Information
Class: ArturRios.Data.Export.Exporters.MessagePackExporter<T>
Assembly: ArturRios.Data.Export
File(s): /home/runner/work/dotnet-data/dotnet-data/src/ArturRios.Data.Export/Exporters/MessagePackExporter.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 20
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage
100%
Covered methods: 2
Fully covered methods: 2
Total methods: 2
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
WriteCoreAsync(...)50%22100%

File(s)

/home/runner/work/dotnet-data/dotnet-data/src/ArturRios.Data.Export/Exporters/MessagePackExporter.cs

#LineLine coverage
 1using ArturRios.Data.Export.Configuration;
 2using MessagePack;
 3using Microsoft.Extensions.Logging;
 4
 5namespace ArturRios.Data.Export.Exporters;
 6
 7/// <summary>Serializes the collection to MessagePack (the binary format) using the contractless resolver.</summary>
 8/// <typeparam name="T">The record type.</typeparam>
 9/// <param name="options">MessagePack options.</param>
 10/// <param name="logger">Optional logger; see <see cref="ExporterBase{T}" />.</param>
 11public class MessagePackExporter<T>(MessagePackOptions options, ILogger<MessagePackExporter<T>>? logger = null)
 812    : ExporterBase<T>(logger) where T : class
 13{
 14    /// <inheritdoc />
 15    protected override Task WriteCoreAsync(IEnumerable<T> data, Stream destination, CancellationToken ct)
 16    {
 417        var array = data as T[] ?? data.ToArray();
 418        return MessagePackSerializer.SerializeAsync(destination, array, options.Effective, ct);
 19    }
 20}