< Summary

Class:Azure.Analytics.Synapse.AccessControl.Models.RoleAssignmentOptions
Assembly:Azure.Analytics.Synapse.AccessControl
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\RoleAssignmentOptions.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\RoleAssignmentOptions.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_RoleId()-100%100%
get_PrincipalId()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\RoleAssignmentOptions.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.Analytics.Synapse.AccessControl.Models
 11{
 12    /// <summary> Role Assignment request details. </summary>
 13    public partial class RoleAssignmentOptions
 14    {
 15        /// <summary> Initializes a new instance of RoleAssignmentOptions. </summary>
 16        /// <param name="roleId"> Role ID of the Synapse Built-In Role. </param>
 17        /// <param name="principalId"> Object ID of the AAD principal or security-group. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="roleId"/> or <paramref name="principalId"/> is null
 419        public RoleAssignmentOptions(string roleId, string principalId)
 20        {
 421            if (roleId == null)
 22            {
 023                throw new ArgumentNullException(nameof(roleId));
 24            }
 425            if (principalId == null)
 26            {
 027                throw new ArgumentNullException(nameof(principalId));
 28            }
 29
 430            RoleId = roleId;
 431            PrincipalId = principalId;
 432        }
 33
 34        /// <summary> Role ID of the Synapse Built-In Role. </summary>
 435        public string RoleId { get; }
 36        /// <summary> Object ID of the AAD principal or security-group. </summary>
 437        public string PrincipalId { get; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\RoleAssignmentOptions.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 RoleAssignmentOptions : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 417            writer.WriteStartObject();
 418            writer.WritePropertyName("roleId");
 419            writer.WriteStringValue(RoleId);
 420            writer.WritePropertyName("principalId");
 421            writer.WriteStringValue(PrincipalId);
 422            writer.WriteEndObject();
 423        }
 24    }
 25}