< Summary

Class:Azure.Security.KeyVault.Administration.Models.RoleAssignment
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignment.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignment.Serialization.cs
Covered lines:27
Uncovered lines:2
Coverable lines:29
Total lines:87
Line coverage:93.1% (27 of 29)
Covered branches:10
Total branches:10
Branch coverage:100% (10 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_Name()-100%100%
get_Type()-100%100%
get_Properties()-100%100%
DeserializeRoleAssignment(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignment.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.Security.KeyVault.Administration.Models
 9{
 10    /// <summary> Role Assignments. </summary>
 11    public partial class RoleAssignment
 12    {
 13        /// <summary> Initializes a new instance of RoleAssignment. </summary>
 014        internal RoleAssignment()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of RoleAssignment. </summary>
 19        /// <param name="id"> The role assignment ID. </param>
 20        /// <param name="name"> The role assignment name. </param>
 21        /// <param name="type"> The role assignment type. </param>
 22        /// <param name="properties"> Role assignment properties. </param>
 10623        internal RoleAssignment(string id, string name, string type, RoleAssignmentPropertiesWithScope properties)
 24        {
 10625            Id = id;
 10626            Name = name;
 10627            Type = type;
 10628            Properties = properties;
 10629        }
 30
 31        /// <summary> The role assignment ID. </summary>
 2032        public string Id { get; }
 33        /// <summary> The role assignment name. </summary>
 6234        public string Name { get; }
 35        /// <summary> The role assignment type. </summary>
 2036        public string Type { get; }
 37        /// <summary> Role assignment properties. </summary>
 8438        public RoleAssignmentPropertiesWithScope Properties { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignment.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.Security.KeyVault.Administration.Models
 12{
 13    public partial class RoleAssignment
 14    {
 15        internal static RoleAssignment DeserializeRoleAssignment(JsonElement element)
 16        {
 10617            Optional<string> id = default;
 10618            Optional<string> name = default;
 10619            Optional<string> type = default;
 10620            Optional<RoleAssignmentPropertiesWithScope> properties = default;
 106021            foreach (var property in element.EnumerateObject())
 22            {
 42423                if (property.NameEquals("id"))
 24                {
 10625                    id = property.Value.GetString();
 10626                    continue;
 27                }
 31828                if (property.NameEquals("name"))
 29                {
 10630                    name = property.Value.GetString();
 10631                    continue;
 32                }
 21233                if (property.NameEquals("type"))
 34                {
 10635                    type = property.Value.GetString();
 10636                    continue;
 37                }
 10638                if (property.NameEquals("properties"))
 39                {
 10640                    properties = RoleAssignmentPropertiesWithScope.DeserializeRoleAssignmentPropertiesWithScope(property
 41                    continue;
 42                }
 43            }
 10644            return new RoleAssignment(id.Value, name.Value, type.Value, properties.Value);
 45        }
 46    }
 47}