< Summary

Class:Azure.Analytics.Synapse.Spark.Models.SparkSessionCollection
Assembly:Azure.Analytics.Synapse.Spark
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Spark\src\Generated\Models\SparkSessionCollection.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Spark\src\Generated\Models\SparkSessionCollection.Serialization.cs
Covered lines:22
Uncovered lines:7
Coverable lines:29
Total lines:88
Line coverage:75.8% (22 of 29)
Covered branches:10
Total branches:10
Branch coverage:100% (10 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_From()-0%100%
get_Total()-0%100%
get_Sessions()-100%100%
DeserializeSparkSessionCollection(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Spark\src\Generated\Models\SparkSessionCollection.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.Analytics.Synapse.Spark.Models
 12{
 13    /// <summary> The SparkSessionCollection. </summary>
 14    public partial class SparkSessionCollection
 15    {
 16        /// <summary> Initializes a new instance of SparkSessionCollection. </summary>
 17        /// <param name="from"> . </param>
 18        /// <param name="total"> . </param>
 019        internal SparkSessionCollection(int @from, int total)
 20        {
 021            From = @from;
 022            Total = total;
 023            Sessions = new ChangeTrackingList<SparkSession>();
 024        }
 25
 26        /// <summary> Initializes a new instance of SparkSessionCollection. </summary>
 27        /// <param name="from"> . </param>
 28        /// <param name="total"> . </param>
 29        /// <param name="sessions"> . </param>
 430        internal SparkSessionCollection(int @from, int total, IReadOnlyList<SparkSession> sessions)
 31        {
 432            From = @from;
 433            Total = total;
 434            Sessions = sessions;
 435        }
 36
 037        public int From { get; }
 038        public int Total { get; }
 439        public IReadOnlyList<SparkSession> Sessions { get; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Spark\src\Generated\Models\SparkSessionCollection.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.Analytics.Synapse.Spark.Models
 13{
 14    public partial class SparkSessionCollection
 15    {
 16        internal static SparkSessionCollection DeserializeSparkSessionCollection(JsonElement element)
 17        {
 418            int @from = default;
 419            int total = default;
 420            Optional<IReadOnlyList<SparkSession>> sessions = default;
 3221            foreach (var property in element.EnumerateObject())
 22            {
 1223                if (property.NameEquals("from"))
 24                {
 425                    @from = property.Value.GetInt32();
 426                    continue;
 27                }
 828                if (property.NameEquals("total"))
 29                {
 430                    total = property.Value.GetInt32();
 431                    continue;
 32                }
 433                if (property.NameEquals("sessions"))
 34                {
 435                    List<SparkSession> array = new List<SparkSession>();
 16836                    foreach (var item in property.Value.EnumerateArray())
 37                    {
 8038                        array.Add(SparkSession.DeserializeSparkSession(item));
 39                    }
 440                    sessions = array;
 41                    continue;
 42                }
 43            }
 444            return new SparkSessionCollection(@from, total, Optional.ToList(sessions));
 45        }
 46    }
 47}