< Summary

Class:Azure.Iot.Hub.Service.Models.QueryResult
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\QueryResult.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\QueryResult.Serialization.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:87
Line coverage:0% (0 of 27)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Type()-0%100%
get_Items()-0%100%
get_ContinuationToken()-0%100%
DeserializeQueryResult(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\QueryResult.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.Iot.Hub.Service.Models
 12{
 13    /// <summary> The query result. </summary>
 14    public partial class QueryResult
 15    {
 16        /// <summary> Initializes a new instance of QueryResult. </summary>
 017        internal QueryResult()
 18        {
 019            Items = new ChangeTrackingList<object>();
 020        }
 21
 22        /// <summary> Initializes a new instance of QueryResult. </summary>
 23        /// <param name="type"> The query result type. </param>
 24        /// <param name="items"> The query result items, as a collection. </param>
 25        /// <param name="continuationToken"> The continuation token. </param>
 026        internal QueryResult(QueryResultType? type, IReadOnlyList<object> items, string continuationToken)
 27        {
 028            Type = type;
 029            Items = items;
 030            ContinuationToken = continuationToken;
 031        }
 32
 33        /// <summary> The query result type. </summary>
 034        public QueryResultType? Type { get; }
 35        /// <summary> The query result items, as a collection. </summary>
 036        public IReadOnlyList<object> Items { get; }
 37        /// <summary> The continuation token. </summary>
 038        public string ContinuationToken { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\QueryResult.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.Iot.Hub.Service.Models
 13{
 14    public partial class QueryResult
 15    {
 16        internal static QueryResult DeserializeQueryResult(JsonElement element)
 17        {
 018            Optional<QueryResultType> type = default;
 019            Optional<IReadOnlyList<object>> items = default;
 020            Optional<string> continuationToken = default;
 021            foreach (var property in element.EnumerateObject())
 22            {
 023                if (property.NameEquals("type"))
 24                {
 025                    type = new QueryResultType(property.Value.GetString());
 026                    continue;
 27                }
 028                if (property.NameEquals("items"))
 29                {
 030                    List<object> array = new List<object>();
 031                    foreach (var item in property.Value.EnumerateArray())
 32                    {
 033                        array.Add(item.GetObject());
 34                    }
 035                    items = array;
 036                    continue;
 37                }
 038                if (property.NameEquals("continuationToken"))
 39                {
 040                    continuationToken = property.Value.GetString();
 41                    continue;
 42                }
 43            }
 044            return new QueryResult(Optional.ToNullable(type), Optional.ToList(items), continuationToken.Value);
 45        }
 46    }
 47}