< Summary

Class:Azure.ResourceManager.Resources.Models.SubscriptionListResult
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SubscriptionListResult.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SubscriptionListResult.Serialization.cs
Covered lines:19
Uncovered lines:7
Coverable lines:26
Total lines:94
Line coverage:73% (19 of 26)
Covered branches:10
Total branches:14
Branch coverage:71.4% (10 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Value()-100%100%
get_NextLink()-100%100%
DeserializeSubscriptionListResult(...)-86.67%83.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SubscriptionListResult.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Resources.Models
 12{
 13    /// <summary> Subscription list operation response. </summary>
 14    public partial class SubscriptionListResult
 15    {
 16        /// <summary> Initializes a new instance of SubscriptionListResult. </summary>
 17        /// <param name="nextLink"> The URL to get the next set of results. </param>
 018        internal SubscriptionListResult(string nextLink)
 19        {
 020            if (nextLink == null)
 21            {
 022                throw new ArgumentNullException(nameof(nextLink));
 23            }
 24
 025            NextLink = nextLink;
 026        }
 27
 28        /// <summary> Initializes a new instance of SubscriptionListResult. </summary>
 29        /// <param name="value"> An array of subscriptions. </param>
 30        /// <param name="nextLink"> The URL to get the next set of results. </param>
 831        internal SubscriptionListResult(IReadOnlyList<Subscription> value, string nextLink)
 32        {
 833            Value = value;
 834            NextLink = nextLink;
 835        }
 36
 37        /// <summary> An array of subscriptions. </summary>
 838        public IReadOnlyList<Subscription> Value { get; }
 39        /// <summary> The URL to get the next set of results. </summary>
 840        public string NextLink { get; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SubscriptionListResult.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Resources.Models
 13{
 14    public partial class SubscriptionListResult
 15    {
 16        internal static SubscriptionListResult DeserializeSubscriptionListResult(JsonElement element)
 17        {
 818            IReadOnlyList<Subscription> value = default;
 819            string nextLink = default;
 4020            foreach (var property in element.EnumerateObject())
 21            {
 1222                if (property.NameEquals("value"))
 23                {
 824                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 828                    List<Subscription> array = new List<Subscription>();
 4829                    foreach (var item in property.Value.EnumerateArray())
 30                    {
 1631                        if (item.ValueKind == JsonValueKind.Null)
 32                        {
 033                            array.Add(null);
 34                        }
 35                        else
 36                        {
 1637                            array.Add(Subscription.DeserializeSubscription(item));
 38                        }
 39                    }
 840                    value = array;
 841                    continue;
 42                }
 443                if (property.NameEquals("nextLink"))
 44                {
 045                    nextLink = property.Value.GetString();
 46                    continue;
 47                }
 48            }
 849            return new SubscriptionListResult(value, nextLink);
 50        }
 51    }
 52}