< Summary

Class:Azure.DigitalTwins.Core.PagedModelDataCollection
Assembly:Azure.DigitalTwins.Core
File(s):C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\PagedModelDataCollection.cs
C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\PagedModelDataCollection.Serialization.cs
Covered lines:18
Uncovered lines:3
Coverable lines:21
Total lines:77
Line coverage:85.7% (18 of 21)
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_Value()-100%100%
get_NextLink()-100%100%
DeserializePagedModelDataCollection(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\PagedModelDataCollection.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 Azure.Core;
 10
 11namespace Azure.DigitalTwins.Core
 12{
 13    /// <summary> A collection of ModelData objects. </summary>
 14    internal partial class PagedModelDataCollection
 15    {
 16        /// <summary> Initializes a new instance of PagedModelDataCollection. </summary>
 017        internal PagedModelDataCollection()
 18        {
 019            Value = new ChangeTrackingList<ModelData>();
 020        }
 21
 22        /// <summary> Initializes a new instance of PagedModelDataCollection. </summary>
 23        /// <param name="value"> The ModelData objects. </param>
 24        /// <param name="nextLink"> A URI to retrieve the next page of objects. </param>
 425        internal PagedModelDataCollection(IReadOnlyList<ModelData> value, string nextLink)
 26        {
 427            Value = value;
 428            NextLink = nextLink;
 429        }
 30
 31        /// <summary> The ModelData objects. </summary>
 432        public IReadOnlyList<ModelData> Value { get; }
 33        /// <summary> A URI to retrieve the next page of objects. </summary>
 434        public string NextLink { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\PagedModelDataCollection.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.DigitalTwins.Core
 13{
 14    internal partial class PagedModelDataCollection
 15    {
 16        internal static PagedModelDataCollection DeserializePagedModelDataCollection(JsonElement element)
 17        {
 418            Optional<IReadOnlyList<ModelData>> value = default;
 419            Optional<string> nextLink = default;
 2420            foreach (var property in element.EnumerateObject())
 21            {
 822                if (property.NameEquals("value"))
 23                {
 424                    List<ModelData> array = new List<ModelData>();
 29625                    foreach (var item in property.Value.EnumerateArray())
 26                    {
 14427                        array.Add(ModelData.DeserializeModelData(item));
 28                    }
 429                    value = array;
 430                    continue;
 31                }
 432                if (property.NameEquals("nextLink"))
 33                {
 434                    nextLink = property.Value.GetString();
 35                    continue;
 36                }
 37            }
 438            return new PagedModelDataCollection(Optional.ToList(value), nextLink.Value);
 39        }
 40    }
 41}