< Summary

Class:Microsoft.Azure.ServiceBus.Amqp.Framing.AmqpCorrelationFilterCodec
Assembly:Microsoft.Azure.ServiceBus
File(s):C:\Git\azure-sdk-for-net\sdk\servicebus\Microsoft.Azure.ServiceBus\src\Amqp\Framing\AmqpCorrelationFilterCodec.cs
Covered lines:0
Uncovered lines:57
Coverable lines:57
Total lines:126
Line coverage:0% (0 of 57)
Covered branches:0
Total branches:18
Branch coverage:0% (0 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.cctor()-0%100%
.ctor()-0%100%
get_CorrelationId()-0%100%
get_MessageId()-0%100%
get_To()-0%100%
get_ReplyTo()-0%100%
get_Label()-0%100%
get_SessionId()-0%100%
get_ReplyToSessionId()-0%100%
get_ContentType()-0%100%
get_Properties()-0%100%
get_FieldCount()-0%100%
ToString()-0%100%
OnEncode(...)-0%100%
OnDecode(...)-0%0%
OnValueSize()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\servicebus\Microsoft.Azure.ServiceBus\src\Amqp\Framing\AmqpCorrelationFilterCodec.cs

#LineLine coverage
 1// Copyright (c) Microsoft. All rights reserved.
 2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
 3
 4namespace Microsoft.Azure.ServiceBus.Amqp.Framing
 5{
 6    using System.Text;
 7    using Azure.Amqp;
 8    using Azure.Amqp.Encoding;
 9
 10    sealed class AmqpCorrelationFilterCodec : AmqpFilterCodec
 11    {
 012        public static readonly string Name = AmqpConstants.Vendor + ":correlation-filter:list";
 13        public const ulong Code = 0x000001370000009;
 14        const int Fields = 9;
 15
 16        AmqpMap properties;
 17
 018        public AmqpCorrelationFilterCodec() : base(Name, Code)
 19        {
 020            this.properties = new AmqpMap();
 021        }
 22
 023        public string CorrelationId { get; set; }
 24
 025        public string MessageId { get; set; }
 26
 027        public string To { get; set; }
 28
 029        public string ReplyTo { get; set; }
 30
 031        public string Label { get; set; }
 32
 033        public string SessionId { get; set; }
 34
 035        public string ReplyToSessionId { get; set; }
 36
 037        public string ContentType { get; set; }
 38
 039        public AmqpMap Properties => this.properties;
 40
 041        protected override int FieldCount => Fields;
 42
 43        public override string ToString()
 44        {
 045            var stringBuilder = new StringBuilder("correlation(");
 046            var count = 0;
 047            this.AddFieldToString(this.CorrelationId != null, stringBuilder, "id", this.CorrelationId, ref count);
 048            stringBuilder.Append(')');
 049            return stringBuilder.ToString();
 50        }
 51
 52        protected override void OnEncode(ByteBuffer buffer)
 53        {
 054            AmqpCodec.EncodeString(this.CorrelationId, buffer);
 055            AmqpCodec.EncodeString(this.MessageId, buffer);
 056            AmqpCodec.EncodeString(this.To, buffer);
 057            AmqpCodec.EncodeString(this.ReplyTo, buffer);
 058            AmqpCodec.EncodeString(this.Label, buffer);
 059            AmqpCodec.EncodeString(this.SessionId, buffer);
 060            AmqpCodec.EncodeString(this.ReplyToSessionId, buffer);
 061            AmqpCodec.EncodeString(this.ContentType, buffer);
 062            AmqpCodec.EncodeMap(this.properties, buffer);
 063        }
 64
 65        protected override void OnDecode(ByteBuffer buffer, int count)
 66        {
 067            if (count-- > 0)
 68            {
 069                this.CorrelationId = AmqpCodec.DecodeString(buffer);
 70            }
 71
 072            if (count-- > 0)
 73            {
 074                this.MessageId = AmqpCodec.DecodeString(buffer);
 75            }
 76
 077            if (count-- > 0)
 78            {
 079                this.To = AmqpCodec.DecodeString(buffer);
 80            }
 81
 082            if (count-- > 0)
 83            {
 084                this.ReplyTo = AmqpCodec.DecodeString(buffer);
 85            }
 86
 087            if (count-- > 0)
 88            {
 089                this.Label = AmqpCodec.DecodeString(buffer);
 90            }
 91
 092            if (count-- > 0)
 93            {
 094                this.SessionId = AmqpCodec.DecodeString(buffer);
 95            }
 96
 097            if (count-- > 0)
 98            {
 099                this.ReplyToSessionId = AmqpCodec.DecodeString(buffer);
 100            }
 101
 0102            if (count-- > 0)
 103            {
 0104                this.ContentType = AmqpCodec.DecodeString(buffer);
 105            }
 106
 0107            if (count > 0)
 108            {
 0109                this.properties = AmqpCodec.DecodeMap(buffer);
 110            }
 0111        }
 112
 113        protected override int OnValueSize()
 114        {
 0115            return AmqpCodec.GetStringEncodeSize(this.CorrelationId) +
 0116                   AmqpCodec.GetStringEncodeSize(this.MessageId) +
 0117                   AmqpCodec.GetStringEncodeSize(this.To) +
 0118                   AmqpCodec.GetStringEncodeSize(this.ReplyTo) +
 0119                   AmqpCodec.GetStringEncodeSize(this.Label) +
 0120                   AmqpCodec.GetStringEncodeSize(this.SessionId) +
 0121                   AmqpCodec.GetStringEncodeSize(this.ReplyToSessionId) +
 0122                   AmqpCodec.GetStringEncodeSize(this.ContentType) +
 0123                   AmqpCodec.GetMapEncodeSize(this.properties);
 124        }
 125    }
 126}