< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.SwitchCase
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SwitchCase.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SwitchCase.Serialization.cs
Covered lines:0
Uncovered lines:33
Coverable lines:33
Total lines:98
Line coverage:0% (0 of 33)
Covered branches:0
Total branches:14
Branch coverage:0% (0 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Value()-0%100%
get_Activities()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSwitchCase(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SwitchCase.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.Artifacts.Models
 12{
 13    /// <summary> Switch cases with have a value and corresponding activities. </summary>
 14    public partial class SwitchCase
 15    {
 16        /// <summary> Initializes a new instance of SwitchCase. </summary>
 017        public SwitchCase()
 18        {
 019            Activities = new ChangeTrackingList<Activity>();
 020        }
 21
 22        /// <summary> Initializes a new instance of SwitchCase. </summary>
 23        /// <param name="value"> Expected value that satisfies the expression result of the &apos;on&apos; property. </p
 24        /// <param name="activities"> List of activities to execute for satisfied case condition. </param>
 025        internal SwitchCase(string value, IList<Activity> activities)
 26        {
 027            Value = value;
 028            Activities = activities;
 029        }
 30
 31        /// <summary> Expected value that satisfies the expression result of the &apos;on&apos; property. </summary>
 032        public string Value { get; set; }
 33        /// <summary> List of activities to execute for satisfied case condition. </summary>
 034        public IList<Activity> Activities { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SwitchCase.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.Artifacts.Models
 13{
 14    public partial class SwitchCase : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(Value))
 20            {
 021                writer.WritePropertyName("value");
 022                writer.WriteStringValue(Value);
 23            }
 024            if (Optional.IsCollectionDefined(Activities))
 25            {
 026                writer.WritePropertyName("activities");
 027                writer.WriteStartArray();
 028                foreach (var item in Activities)
 29                {
 030                    writer.WriteObjectValue(item);
 31                }
 032                writer.WriteEndArray();
 33            }
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static SwitchCase DeserializeSwitchCase(JsonElement element)
 38        {
 039            Optional<string> value = default;
 040            Optional<IList<Activity>> activities = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("value"))
 44                {
 045                    value = property.Value.GetString();
 046                    continue;
 47                }
 048                if (property.NameEquals("activities"))
 49                {
 050                    List<Activity> array = new List<Activity>();
 051                    foreach (var item in property.Value.EnumerateArray())
 52                    {
 053                        array.Add(Activity.DeserializeActivity(item));
 54                    }
 055                    activities = array;
 56                    continue;
 57                }
 58            }
 059            return new SwitchCase(value.Value, Optional.ToList(activities));
 60        }
 61    }
 62}