< Summary

Class:Azure.Security.KeyVault.Administration.Models.RoleAssignmentPropertiesWithScope
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignmentPropertiesWithScope.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignmentPropertiesWithScope.Serialization.cs
Covered lines:21
Uncovered lines:2
Coverable lines:23
Total lines:77
Line coverage:91.3% (21 of 23)
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_Scope()-100%100%
get_RoleDefinitionId()-100%100%
get_PrincipalId()-100%100%
DeserializeRoleAssignmentPropertiesWithScope(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignmentPropertiesWithScope.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 assignment properties with scope. </summary>
 11    public partial class RoleAssignmentPropertiesWithScope
 12    {
 13        /// <summary> Initializes a new instance of RoleAssignmentPropertiesWithScope. </summary>
 014        internal RoleAssignmentPropertiesWithScope()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of RoleAssignmentPropertiesWithScope. </summary>
 19        /// <param name="scope"> The role assignment scope. </param>
 20        /// <param name="roleDefinitionId"> The role definition ID. </param>
 21        /// <param name="principalId"> The principal ID. </param>
 10622        internal RoleAssignmentPropertiesWithScope(string scope, string roleDefinitionId, string principalId)
 23        {
 10624            Scope = scope;
 10625            RoleDefinitionId = roleDefinitionId;
 10626            PrincipalId = principalId;
 10627        }
 28
 29        /// <summary> The role assignment scope. </summary>
 3230        public string Scope { get; }
 31        /// <summary> The role definition ID. </summary>
 2632        public string RoleDefinitionId { get; }
 33        /// <summary> The principal ID. </summary>
 2634        public string PrincipalId { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignmentPropertiesWithScope.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 RoleAssignmentPropertiesWithScope
 14    {
 15        internal static RoleAssignmentPropertiesWithScope DeserializeRoleAssignmentPropertiesWithScope(JsonElement eleme
 16        {
 10617            Optional<string> scope = default;
 10618            Optional<string> roleDefinitionId = default;
 10619            Optional<string> principalId = default;
 84820            foreach (var property in element.EnumerateObject())
 21            {
 31822                if (property.NameEquals("scope"))
 23                {
 10624                    scope = property.Value.GetString();
 10625                    continue;
 26                }
 21227                if (property.NameEquals("roleDefinitionId"))
 28                {
 10629                    roleDefinitionId = property.Value.GetString();
 10630                    continue;
 31                }
 10632                if (property.NameEquals("principalId"))
 33                {
 10634                    principalId = property.Value.GetString();
 35                    continue;
 36                }
 37            }
 10638            return new RoleAssignmentPropertiesWithScope(scope.Value, roleDefinitionId.Value, principalId.Value);
 39        }
 40    }
 41}