< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.KafkaMessageProperty
Assembly: CoreWCF.Kafka
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka/src/CoreWCF/Channels/KafkaMessageProperty.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 30
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%22100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka/src/CoreWCF/Channels/KafkaMessageProperty.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Collections.Generic;
 6using Confluent.Kafka;
 7
 8namespace CoreWCF.Channels;
 9
 10public sealed class KafkaMessageProperty
 11{
 71312    private readonly IList<KafkaMessageHeader> _headers = new List<KafkaMessageHeader>();
 13
 14    public const string Name = "CoreWCF.Channels.KafkaMessageProperty";
 15
 71316    internal KafkaMessageProperty(ConsumeResult<byte[], byte[]> consumeResult)
 17    {
 143418        foreach (IHeader messageHeader in consumeResult.Message.Headers)
 19        {
 420            _headers.Add(new KafkaMessageHeader(messageHeader.Key, messageHeader.GetValueBytes()));
 21        }
 22
 71323        PartitionKey = consumeResult.Message.Key;
 71324        Topic = consumeResult.Topic;
 71325    }
 26
 427    public IReadOnlyCollection<KafkaMessageHeader> Headers => _headers as IReadOnlyCollection<KafkaMessageHeader>;
 428    public ReadOnlyMemory<byte> PartitionKey { get; }
 429    public string Topic { get; }
 30}