< Summary

Class:Azure.ResourceManager.Compute.Models.SourceVault
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SourceVault.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SourceVault.Serialization.cs
Covered lines:16
Uncovered lines:2
Coverable lines:18
Total lines:72
Line coverage:88.8% (16 of 18)
Covered branches:8
Total branches:8
Branch coverage:100% (8 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeSourceVault(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SourceVault.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
 8namespace Azure.ResourceManager.Compute.Models
 9{
 10    /// <summary> The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/reso
 11    public partial class SourceVault
 12    {
 13        /// <summary> Initializes a new instance of SourceVault. </summary>
 014        public SourceVault()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of SourceVault. </summary>
 19        /// <param name="id"> Resource Id. </param>
 8020        internal SourceVault(string id)
 21        {
 8022            Id = id;
 8023        }
 24
 25        /// <summary> Resource Id. </summary>
 20026        public string Id { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SourceVault.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    public partial class SourceVault : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 4817            writer.WriteStartObject();
 4818            if (Id != null)
 19            {
 4820                writer.WritePropertyName("id");
 4821                writer.WriteStringValue(Id);
 22            }
 4823            writer.WriteEndObject();
 4824        }
 25
 26        internal static SourceVault DeserializeSourceVault(JsonElement element)
 27        {
 6028            string id = default;
 24029            foreach (var property in element.EnumerateObject())
 30            {
 6031                if (property.NameEquals("id"))
 32                {
 6033                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 6037                    id = property.Value.GetString();
 38                    continue;
 39                }
 40            }
 6041            return new SourceVault(id);
 42        }
 43    }
 44}