< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.cctor()-0%100%
.ctor()-0%100%
get_Filter()-0%100%
set_Filter(...)-0%100%
get_Action()-0%100%
set_Action(...)-0%100%
get_RuleName()-0%100%
set_RuleName(...)-0%100%
get_CreatedAt()-0%100%
get_FieldCount()-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\AmqpRuleDescriptionCodec.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;
 7    using Azure.Amqp;
 8    using Azure.Amqp.Framing;
 9
 10    sealed class AmqpRuleDescriptionCodec : DescribedList
 11    {
 012        public static readonly string Name = AmqpConstants.Vendor + ":rule-description:list";
 13        public const ulong Code = 0x0000013700000004;
 14        const int Fields = 4;
 15
 016        public AmqpRuleDescriptionCodec() : base(Name, Code) { }
 17
 18        public AmqpFilterCodec Filter
 19        {
 020            get;
 021            set;
 22        }
 23
 24        public AmqpRuleActionCodec Action
 25        {
 026            get;
 027            set;
 28        }
 29
 30        public string RuleName
 31        {
 032            get;
 033            set;
 34        }
 35
 036        public DateTime? CreatedAt { get; set; }
 37
 038        protected override int FieldCount => Fields;
 39
 40        protected override void OnEncode(ByteBuffer buffer)
 41        {
 042            AmqpCodec.EncodeSerializable(this.Filter, buffer);
 043            AmqpCodec.EncodeSerializable(this.Action, buffer);
 044            AmqpCodec.EncodeString(this.RuleName, buffer);
 045            AmqpCodec.EncodeTimeStamp(this.CreatedAt, buffer);
 046        }
 47
 48        protected override void OnDecode(ByteBuffer buffer, int count)
 49        {
 050            if (count-- > 0)
 51            {
 052                this.Filter = (AmqpFilterCodec)AmqpCodec.DecodeAmqpDescribed(buffer);
 53            }
 54
 055            if (count-- > 0)
 56            {
 057                this.Action = (AmqpRuleActionCodec)AmqpCodec.DecodeAmqpDescribed(buffer);
 58            }
 59
 060            if (count-- > 0)
 61            {
 062                this.RuleName = AmqpCodec.DecodeString(buffer);
 63            }
 64
 065            if (count > 0)
 66            {
 067                this.CreatedAt = AmqpCodec.DecodeTimeStamp(buffer);
 68            }
 069        }
 70
 71        protected override int OnValueSize()
 72        {
 073            return AmqpCodec.GetSerializableEncodeSize(this.Filter) +
 074                   AmqpCodec.GetSerializableEncodeSize(this.Action) +
 075                   AmqpCodec.GetStringEncodeSize(this.RuleName) +
 076                   AmqpCodec.GetTimeStampEncodeSize(this.CreatedAt);
 77        }
 78    }
 79}