< Summary

Class:Azure.Analytics.Synapse.AccessControl.Models.SynapseRole
Assembly:Azure.Analytics.Synapse.AccessControl
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\SynapseRole.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\SynapseRole.Serialization.cs
Covered lines:21
Uncovered lines:3
Coverable lines:24
Total lines:79
Line coverage:87.5% (21 of 24)
Covered branches:8
Total branches:8
Branch coverage:100% (8 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_Name()-100%100%
get_IsBuiltIn()-100%100%
DeserializeSynapseRole(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\SynapseRole.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.Analytics.Synapse.AccessControl.Models
 9{
 10    /// <summary> Synapse role details. </summary>
 11    public partial class SynapseRole
 12    {
 13        /// <summary> Initializes a new instance of SynapseRole. </summary>
 14        /// <param name="isBuiltIn"> Is a built-in role or not. </param>
 015        internal SynapseRole(bool isBuiltIn)
 16        {
 017            IsBuiltIn = isBuiltIn;
 018        }
 19
 20        /// <summary> Initializes a new instance of SynapseRole. </summary>
 21        /// <param name="id"> Role ID. </param>
 22        /// <param name="name"> Name of the Synapse role. </param>
 23        /// <param name="isBuiltIn"> Is a built-in role or not. </param>
 3624        internal SynapseRole(string id, string name, bool isBuiltIn)
 25        {
 3626            Id = id;
 3627            Name = name;
 3628            IsBuiltIn = isBuiltIn;
 3629        }
 30
 31        /// <summary> Role ID. </summary>
 4832        public string Id { get; }
 33        /// <summary> Name of the Synapse role. </summary>
 2434        public string Name { get; }
 35        /// <summary> Is a built-in role or not. </summary>
 3636        public bool IsBuiltIn { get; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\SynapseRole.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Analytics.Synapse.AccessControl.Models
 12{
 13    public partial class SynapseRole
 14    {
 15        internal static SynapseRole DeserializeSynapseRole(JsonElement element)
 16        {
 3617            Optional<string> id = default;
 3618            Optional<string> name = default;
 3619            bool isBuiltIn = default;
 28820            foreach (var property in element.EnumerateObject())
 21            {
 10822                if (property.NameEquals("id"))
 23                {
 3624                    id = property.Value.GetString();
 3625                    continue;
 26                }
 7227                if (property.NameEquals("name"))
 28                {
 3629                    name = property.Value.GetString();
 3630                    continue;
 31                }
 3632                if (property.NameEquals("isBuiltIn"))
 33                {
 3634                    isBuiltIn = property.Value.GetBoolean();
 35                    continue;
 36                }
 37            }
 3638            return new SynapseRole(id.Value, name.Value, isBuiltIn);
 39        }
 40    }
 41}