< Summary

Class:Azure.ResourceManager.Resources.Models.Tags
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Tags.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Tags.Serialization.cs
Covered lines:26
Uncovered lines:1
Coverable lines:27
Total lines:93
Line coverage:96.2% (26 of 27)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_TagsValue()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeTags(...)-90.91%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Tags.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;
 9
 10namespace Azure.ResourceManager.Resources.Models
 11{
 12    /// <summary> A dictionary of name and value pairs. </summary>
 13    public partial class Tags
 14    {
 15        /// <summary> Initializes a new instance of Tags. </summary>
 4816        public Tags()
 17        {
 4818        }
 19
 20        /// <summary> Initializes a new instance of Tags. </summary>
 21        /// <param name="tagsValue"> Dictionary of &lt;string&gt;. </param>
 7222        internal Tags(IDictionary<string, string> tagsValue)
 23        {
 7224            TagsValue = tagsValue;
 7225        }
 26
 27        /// <summary> Dictionary of &lt;string&gt;. </summary>
 58428        public IDictionary<string, string> TagsValue { get; set; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Tags.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.ResourceManager.Resources.Models
 13{
 14    public partial class Tags : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 5618            writer.WriteStartObject();
 5619            if (TagsValue != null)
 20            {
 5621                writer.WritePropertyName("tags");
 5622                writer.WriteStartObject();
 33623                foreach (var item in TagsValue)
 24                {
 11225                    writer.WritePropertyName(item.Key);
 11226                    writer.WriteStringValue(item.Value);
 27                }
 5628                writer.WriteEndObject();
 29            }
 5630            writer.WriteEndObject();
 5631        }
 32
 33        internal static Tags DeserializeTags(JsonElement element)
 34        {
 7235            IDictionary<string, string> tags = default;
 28036            foreach (var property in element.EnumerateObject())
 37            {
 6838                if (property.NameEquals("tags"))
 39                {
 6840                    if (property.Value.ValueKind == JsonValueKind.Null)
 41                    {
 42                        continue;
 43                    }
 6844                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 37645                    foreach (var property0 in property.Value.EnumerateObject())
 46                    {
 12047                        if (property0.Value.ValueKind == JsonValueKind.Null)
 48                        {
 049                            dictionary.Add(property0.Name, null);
 50                        }
 51                        else
 52                        {
 12053                            dictionary.Add(property0.Name, property0.Value.GetString());
 54                        }
 55                    }
 6856                    tags = dictionary;
 57                    continue;
 58                }
 59            }
 7260            return new Tags(tags);
 61        }
 62    }
 63}