< Summary

Class:Azure.Data.Tables.Models.RetentionPolicy
Assembly:Azure.Data.Tables
File(s):C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\RetentionPolicy.cs
C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\RetentionPolicy.Serialization.cs
Covered lines:23
Uncovered lines:3
Coverable lines:26
Total lines:80
Line coverage:88.4% (23 of 26)
Covered branches:7
Total branches:8
Branch coverage:87.5% (7 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_Enabled()-100%100%
get_Days()-100%100%
Azure.Core.IXmlSerializable.Write(...)-100%75%
DeserializeRetentionPolicy(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\RetentionPolicy.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8namespace Azure.Data.Tables.Models
 9{
 10    /// <summary> The retention policy. </summary>
 11    public partial class RetentionPolicy
 12    {
 13        /// <summary> Initializes a new instance of RetentionPolicy. </summary>
 14        /// <param name="enabled"> Indicates whether a retention policy is enabled for the service. </param>
 015        public RetentionPolicy(bool enabled)
 16        {
 017            Enabled = enabled;
 018        }
 19
 20        /// <summary> Initializes a new instance of RetentionPolicy. </summary>
 21        /// <param name="enabled"> Indicates whether a retention policy is enabled for the service. </param>
 22        /// <param name="days"> Indicates the number of days that metrics or logging or soft-deleted data should be reta
 7223        internal RetentionPolicy(bool enabled, int? days)
 24        {
 7225            Enabled = enabled;
 7226            Days = days;
 7227        }
 28
 29        /// <summary> Indicates whether a retention policy is enabled for the service. </summary>
 10830        public bool Enabled { get; set; }
 31        /// <summary> Indicates the number of days that metrics or logging or soft-deleted data should be retained. All 
 11232        public int? Days { get; set; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\RetentionPolicy.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Xml;
 9using System.Xml.Linq;
 10using Azure.Core;
 11
 12namespace Azure.Data.Tables.Models
 13{
 14    public partial class RetentionPolicy : IXmlSerializable
 15    {
 16        void IXmlSerializable.Write(XmlWriter writer, string nameHint)
 17        {
 1218            writer.WriteStartElement(nameHint ?? "RetentionPolicy");
 1219            writer.WriteStartElement("Enabled");
 1220            writer.WriteValue(Enabled);
 1221            writer.WriteEndElement();
 1222            if (Optional.IsDefined(Days))
 23            {
 424                writer.WriteStartElement("Days");
 425                writer.WriteValue(Days.Value);
 426                writer.WriteEndElement();
 27            }
 1228            writer.WriteEndElement();
 1229        }
 30
 31        internal static RetentionPolicy DeserializeRetentionPolicy(XElement element)
 32        {
 7233            bool enabled = default;
 7234            int? days = default;
 7235            if (element.Element("Enabled") is XElement enabledElement)
 36            {
 7237                enabled = (bool)enabledElement;
 38            }
 7239            if (element.Element("Days") is XElement daysElement)
 40            {
 2441                days = (int?)daysElement;
 42            }
 7243            return new RetentionPolicy(enabled, days);
 44        }
 45    }
 46}