< Summary

Class:Azure.Security.KeyVault.Administration.Models.RoleAssignmentProperties
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignmentProperties.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignmentProperties.Serialization.cs
Covered lines:15
Uncovered lines:2
Coverable lines:17
Total lines:64
Line coverage:88.2% (15 of 17)
Covered branches:2
Total branches:4
Branch coverage:50% (2 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
get_RoleDefinitionId()-100%100%
get_PrincipalId()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignmentProperties.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.Security.KeyVault.Administration.Models
 11{
 12    /// <summary> Role assignment properties. </summary>
 13    public partial class RoleAssignmentProperties
 14    {
 15        /// <summary> Initializes a new instance of RoleAssignmentProperties. </summary>
 16        /// <param name="roleDefinitionId"> The role definition ID used in the role assignment. </param>
 17        /// <param name="principalId"> The principal ID assigned to the role. This maps to the ID inside the Active Dire
 18        /// <exception cref="ArgumentNullException"> <paramref name="roleDefinitionId"/> or <paramref name="principalId"
 2219        public RoleAssignmentProperties(string roleDefinitionId, string principalId)
 20        {
 2221            if (roleDefinitionId == null)
 22            {
 023                throw new ArgumentNullException(nameof(roleDefinitionId));
 24            }
 2225            if (principalId == null)
 26            {
 027                throw new ArgumentNullException(nameof(principalId));
 28            }
 29
 2230            RoleDefinitionId = roleDefinitionId;
 2231            PrincipalId = principalId;
 2232        }
 33
 34        /// <summary> The role definition ID used in the role assignment. </summary>
 3035        public string RoleDefinitionId { get; }
 36        /// <summary> The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can poi
 3037        public string PrincipalId { get; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\RoleAssignmentProperties.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 RoleAssignmentProperties : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 2617            writer.WriteStartObject();
 2618            writer.WritePropertyName("roleDefinitionId");
 2619            writer.WriteStringValue(RoleDefinitionId);
 2620            writer.WritePropertyName("principalId");
 2621            writer.WriteStringValue(PrincipalId);
 2622            writer.WriteEndObject();
 2623        }
 24    }
 25}