< Summary

Class:Azure.Data.Tables.Models.SignedIdentifier
Assembly:Azure.Data.Tables
File(s):C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\SignedIdentifier.cs
C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\SignedIdentifier.Serialization.cs
Covered lines:22
Uncovered lines:2
Coverable lines:24
Total lines:80
Line coverage:91.6% (22 of 24)
Covered branches:7
Total branches:10
Branch coverage:70% (7 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
get_Id()-100%100%
get_AccessPolicy()-100%100%
Azure.Core.IXmlSerializable.Write(...)-100%50%
DeserializeSignedIdentifier(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\SignedIdentifier.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;
 9
 10namespace Azure.Data.Tables.Models
 11{
 12    /// <summary> A signed identifier. </summary>
 13    public partial class SignedIdentifier
 14    {
 15        /// <summary> Initializes a new instance of SignedIdentifier. </summary>
 16        /// <param name="id"> A unique id. </param>
 17        /// <param name="accessPolicy"> The access policy. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="id"/> or <paramref name="accessPolicy"/> is null. <
 819        public SignedIdentifier(string id, TableAccessPolicy accessPolicy)
 20        {
 821            if (id == null)
 22            {
 023                throw new ArgumentNullException(nameof(id));
 24            }
 825            if (accessPolicy == null)
 26            {
 027                throw new ArgumentNullException(nameof(accessPolicy));
 28            }
 29
 830            Id = id;
 831            AccessPolicy = accessPolicy;
 832        }
 33
 34        /// <summary> A unique id. </summary>
 2035        public string Id { get; set; }
 36        /// <summary> The access policy. </summary>
 3637        public TableAccessPolicy AccessPolicy { get; set; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\SignedIdentifier.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 SignedIdentifier : IXmlSerializable
 15    {
 16        void IXmlSerializable.Write(XmlWriter writer, string nameHint)
 17        {
 418            writer.WriteStartElement(nameHint ?? "SignedIdentifier");
 419            writer.WriteStartElement("Id");
 420            writer.WriteValue(Id);
 421            writer.WriteEndElement();
 422            writer.WriteObjectValue(AccessPolicy, "AccessPolicy");
 423            writer.WriteEndElement();
 424        }
 25
 26        internal static SignedIdentifier DeserializeSignedIdentifier(XElement element)
 27        {
 428            string id = default;
 429            TableAccessPolicy accessPolicy = default;
 430            if (element.Element("Id") is XElement idElement)
 31            {
 432                id = (string)idElement;
 33            }
 434            if (element.Element("AccessPolicy") is XElement accessPolicyElement)
 35            {
 436                accessPolicy = TableAccessPolicy.DeserializeTableAccessPolicy(accessPolicyElement);
 37            }
 438            return new SignedIdentifier(id, accessPolicy);
 39        }
 40    }
 41}