< Summary

Class:Azure.Data.Tables.Models.TableServiceProperties
Assembly:Azure.Data.Tables
File(s):C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableServiceProperties.cs
C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableServiceProperties.Serialization.cs
Covered lines:36
Uncovered lines:7
Coverable lines:43
Total lines:118
Line coverage:83.7% (36 of 43)
Covered branches:19
Total branches:22
Branch coverage:86.3% (19 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Logging()-100%100%
get_HourMetrics()-100%100%
get_MinuteMetrics()-100%100%
get_Cors()-100%100%
Azure.Core.IXmlSerializable.Write(...)-85.71%83.33%
DeserializeTableServiceProperties(...)-87.5%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableServiceProperties.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.Collections.Generic;
 9using Azure.Core;
 10
 11namespace Azure.Data.Tables.Models
 12{
 13    /// <summary> Table Service Properties. </summary>
 14    public partial class TableServiceProperties
 15    {
 16        /// <summary> Initializes a new instance of TableServiceProperties. </summary>
 017        public TableServiceProperties()
 18        {
 019            Cors = new ChangeTrackingList<TableCorsRule>();
 020        }
 21
 22        /// <summary> Initializes a new instance of TableServiceProperties. </summary>
 23        /// <param name="logging"> Azure Analytics Logging settings. </param>
 24        /// <param name="hourMetrics"> A summary of request statistics grouped by API in hourly aggregates for tables. <
 25        /// <param name="minuteMetrics"> A summary of request statistics grouped by API in minute aggregates for tables.
 26        /// <param name="cors"> The set of CORS rules. </param>
 2427        internal TableServiceProperties(TableAnalyticsLoggingSettings logging, TableMetrics hourMetrics, TableMetrics mi
 28        {
 2429            Logging = logging;
 2430            HourMetrics = hourMetrics;
 2431            MinuteMetrics = minuteMetrics;
 2432            Cors = cors;
 2433        }
 34
 35        /// <summary> Azure Analytics Logging settings. </summary>
 8836        public TableAnalyticsLoggingSettings Logging { get; set; }
 37        /// <summary> A summary of request statistics grouped by API in hourly aggregates for tables. </summary>
 7238        public TableMetrics HourMetrics { get; set; }
 39        /// <summary> A summary of request statistics grouped by API in minute aggregates for tables. </summary>
 7240        public TableMetrics MinuteMetrics { get; set; }
 41        /// <summary> The set of CORS rules. </summary>
 2042        public IList<TableCorsRule> Cors { get; }
 43    }
 44}

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableServiceProperties.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.Collections.Generic;
 9using System.Xml;
 10using System.Xml.Linq;
 11using Azure.Core;
 12
 13namespace Azure.Data.Tables.Models
 14{
 15    public partial class TableServiceProperties : IXmlSerializable
 16    {
 17        void IXmlSerializable.Write(XmlWriter writer, string nameHint)
 18        {
 419            writer.WriteStartElement(nameHint ?? "StorageServiceProperties");
 420            if (Optional.IsDefined(Logging))
 21            {
 422                writer.WriteObjectValue(Logging, "Logging");
 23            }
 424            if (Optional.IsDefined(HourMetrics))
 25            {
 426                writer.WriteObjectValue(HourMetrics, "HourMetrics");
 27            }
 428            if (Optional.IsDefined(MinuteMetrics))
 29            {
 430                writer.WriteObjectValue(MinuteMetrics, "MinuteMetrics");
 31            }
 432            if (Optional.IsCollectionDefined(Cors))
 33            {
 434                writer.WriteStartElement("Cors");
 035                foreach (var item in Cors)
 36                {
 037                    writer.WriteObjectValue(item, "CorsRule");
 38                }
 439                writer.WriteEndElement();
 40            }
 441            writer.WriteEndElement();
 442        }
 43
 44        internal static TableServiceProperties DeserializeTableServiceProperties(XElement element)
 45        {
 2446            TableAnalyticsLoggingSettings logging = default;
 2447            TableMetrics hourMetrics = default;
 2448            TableMetrics minuteMetrics = default;
 2449            IList<TableCorsRule> cors = default;
 2450            if (element.Element("Logging") is XElement loggingElement)
 51            {
 2452                logging = TableAnalyticsLoggingSettings.DeserializeTableAnalyticsLoggingSettings(loggingElement);
 53            }
 2454            if (element.Element("HourMetrics") is XElement hourMetricsElement)
 55            {
 2456                hourMetrics = TableMetrics.DeserializeTableMetrics(hourMetricsElement);
 57            }
 2458            if (element.Element("MinuteMetrics") is XElement minuteMetricsElement)
 59            {
 2460                minuteMetrics = TableMetrics.DeserializeTableMetrics(minuteMetricsElement);
 61            }
 2462            if (element.Element("Cors") is XElement corsElement)
 63            {
 2464                var array = new List<TableCorsRule>();
 065                foreach (var e in corsElement.Elements("CorsRule"))
 66                {
 067                    array.Add(TableCorsRule.DeserializeTableCorsRule(e));
 68                }
 2469                cors = array;
 70            }
 2471            return new TableServiceProperties(logging, hourMetrics, minuteMetrics, cors);
 72        }
 73    }
 74}