< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.NotebookMetadata
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookMetadata.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookMetadata.Serialization.cs
Covered lines:18
Uncovered lines:37
Coverable lines:55
Total lines:138
Line coverage:32.7% (18 of 55)
Covered branches:7
Total branches:14
Branch coverage:50% (7 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Kernelspec()-0%100%
get_LanguageInfo()-0%100%
get_AdditionalProperties()-0%100%
GetEnumerator()-0%100%
System.Collections.IEnumerable.GetEnumerator()-0%100%
TryGetValue(...)-0%100%
ContainsKey(...)-0%100%
get_Keys()-0%100%
get_Values()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_Count()-0%100%
Add(...)-0%100%
Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_IsReadOnly()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Add(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Contains(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.CopyTo(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Clear()-0%100%
get_Item(...)-0%100%
set_Item(...)-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeNotebookMetadata(...)-86.67%87.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookMetadata.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;
 9using System.Collections.Generic;
 10using Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.Artifacts.Models
 13{
 14    /// <summary> Notebook root-level metadata. </summary>
 15    public partial class NotebookMetadata : IDictionary<string, object>
 16    {
 17        /// <summary> Initializes a new instance of NotebookMetadata. </summary>
 018        public NotebookMetadata()
 19        {
 020            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
 021        }
 22
 23        /// <summary> Initializes a new instance of NotebookMetadata. </summary>
 24        /// <param name="kernelspec"> Kernel information. </param>
 25        /// <param name="languageInfo"> Language info. </param>
 26        /// <param name="additionalProperties"> . </param>
 2427        internal NotebookMetadata(NotebookKernelSpec kernelspec, NotebookLanguageInfo languageInfo, IDictionary<string, 
 28        {
 2429            Kernelspec = kernelspec;
 2430            LanguageInfo = languageInfo;
 2431            AdditionalProperties = additionalProperties;
 2432        }
 33
 34        /// <summary> Kernel information. </summary>
 035        public NotebookKernelSpec Kernelspec { get; set; }
 36        /// <summary> Language info. </summary>
 037        public NotebookLanguageInfo LanguageInfo { get; set; }
 038        internal IDictionary<string, object> AdditionalProperties { get; }
 39        /// <inheritdoc />
 040        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
 41        /// <inheritdoc />
 042        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
 43        /// <inheritdoc />
 044        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
 45        /// <inheritdoc />
 046        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
 47        /// <inheritdoc />
 048        public ICollection<string> Keys => AdditionalProperties.Keys;
 49        /// <inheritdoc />
 050        public ICollection<object> Values => AdditionalProperties.Values;
 51        /// <inheritdoc />
 052        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
 53        /// <inheritdoc />
 054        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
 55        /// <inheritdoc />
 056        public bool Remove(string key) => AdditionalProperties.Remove(key);
 57        /// <inheritdoc />
 058        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
 59        /// <inheritdoc />
 060        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.A
 61        /// <inheritdoc />
 062        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalPropertie
 63        /// <inheritdoc />
 064        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalPropert
 65        /// <inheritdoc />
 066        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) =>
 67        /// <inheritdoc />
 068        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
 69        /// <inheritdoc />
 70        public object this[string key]
 71        {
 072            get => AdditionalProperties[key];
 073            set => AdditionalProperties[key] = value;
 74        }
 75    }
 76}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\NotebookMetadata.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 NotebookMetadata : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(Kernelspec))
 20            {
 021                writer.WritePropertyName("kernelspec");
 022                writer.WriteObjectValue(Kernelspec);
 23            }
 024            if (Optional.IsDefined(LanguageInfo))
 25            {
 026                writer.WritePropertyName("language_info");
 027                writer.WriteObjectValue(LanguageInfo);
 28            }
 029            foreach (var item in AdditionalProperties)
 30            {
 031                writer.WritePropertyName(item.Key);
 032                writer.WriteObjectValue(item.Value);
 33            }
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static NotebookMetadata DeserializeNotebookMetadata(JsonElement element)
 38        {
 2439            Optional<NotebookKernelSpec> kernelspec = default;
 2440            Optional<NotebookLanguageInfo> languageInfo = default;
 2441            IDictionary<string, object> additionalProperties = default;
 2442            Dictionary<string, object> additionalPropertiesDictionary = default;
 14443            foreach (var property in element.EnumerateObject())
 44            {
 4845                if (property.NameEquals("kernelspec"))
 46                {
 047                    kernelspec = NotebookKernelSpec.DeserializeNotebookKernelSpec(property.Value);
 048                    continue;
 49                }
 4850                if (property.NameEquals("language_info"))
 51                {
 2452                    languageInfo = NotebookLanguageInfo.DeserializeNotebookLanguageInfo(property.Value);
 2453                    continue;
 54                }
 2455                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 2456                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 57            }
 2458            additionalProperties = additionalPropertiesDictionary;
 2459            return new NotebookMetadata(kernelspec.Value, languageInfo.Value, additionalProperties);
 60        }
 61    }
 62}