< Summary

Class:Azure.ResourceManager.Compute.Models.RunCommandDocumentBase
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandDocumentBase.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandDocumentBase.Serialization.cs
Covered lines:33
Uncovered lines:8
Coverable lines:41
Total lines:111
Line coverage:80.4% (33 of 41)
Covered branches:16
Total branches:20
Branch coverage:80% (16 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-73.33%50%
get_Schema()-0%100%
get_Id()-100%100%
get_OsType()-0%100%
get_Label()-0%100%
get_Description()-0%100%
DeserializeRunCommandDocumentBase(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandDocumentBase.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;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Describes the properties of a Run Command metadata. </summary>
 13    public partial class RunCommandDocumentBase
 14    {
 15        /// <summary> Initializes a new instance of RunCommandDocumentBase. </summary>
 16        /// <param name="schema"> The VM run command schema. </param>
 17        /// <param name="id"> The VM run command id. </param>
 18        /// <param name="osType"> The Operating System type. </param>
 19        /// <param name="label"> The VM run command label. </param>
 20        /// <param name="description"> The VM run command description. </param>
 6421        internal RunCommandDocumentBase(string schema, string id, OperatingSystemTypes osType, string label, string desc
 22        {
 6423            if (schema == null)
 24            {
 025                throw new ArgumentNullException(nameof(schema));
 26            }
 6427            if (id == null)
 28            {
 029                throw new ArgumentNullException(nameof(id));
 30            }
 6431            if (label == null)
 32            {
 033                throw new ArgumentNullException(nameof(label));
 34            }
 6435            if (description == null)
 36            {
 037                throw new ArgumentNullException(nameof(description));
 38            }
 39
 6440            Schema = schema;
 6441            Id = id;
 6442            OsType = osType;
 6443            Label = label;
 6444            Description = description;
 6445        }
 46
 47        /// <summary> The VM run command schema. </summary>
 048        public string Schema { get; }
 49        /// <summary> The VM run command id. </summary>
 1250        public string Id { get; }
 51        /// <summary> The Operating System type. </summary>
 052        public OperatingSystemTypes OsType { get; }
 53        /// <summary> The VM run command label. </summary>
 054        public string Label { get; }
 55        /// <summary> The VM run command description. </summary>
 056        public string Description { get; }
 57    }
 58}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandDocumentBase.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 RunCommandDocumentBase
 14    {
 15        internal static RunCommandDocumentBase DeserializeRunCommandDocumentBase(JsonElement element)
 16        {
 6017            string schema = default;
 6018            string id = default;
 6019            OperatingSystemTypes osType = default;
 6020            string label = default;
 6021            string description = default;
 72022            foreach (var property in element.EnumerateObject())
 23            {
 30024                if (property.NameEquals("$schema"))
 25                {
 6026                    schema = property.Value.GetString();
 6027                    continue;
 28                }
 24029                if (property.NameEquals("id"))
 30                {
 6031                    id = property.Value.GetString();
 6032                    continue;
 33                }
 18034                if (property.NameEquals("osType"))
 35                {
 6036                    osType = property.Value.GetString().ToOperatingSystemTypes();
 6037                    continue;
 38                }
 12039                if (property.NameEquals("label"))
 40                {
 6041                    label = property.Value.GetString();
 6042                    continue;
 43                }
 6044                if (property.NameEquals("description"))
 45                {
 6046                    description = property.Value.GetString();
 47                    continue;
 48                }
 49            }
 6050            return new RunCommandDocumentBase(schema, id, osType, label, description);
 51        }
 52    }
 53}