< Summary

Class:Azure.ResourceManager.Compute.Models.WindowsConfiguration
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\WindowsConfiguration.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\WindowsConfiguration.Serialization.cs
Covered lines:39
Uncovered lines:27
Coverable lines:66
Total lines:168
Line coverage:59% (39 of 66)
Covered branches:20
Total branches:38
Branch coverage:52.6% (20 of 38)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ProvisionVMAgent()-100%100%
get_EnableAutomaticUpdates()-100%100%
get_TimeZone()-100%100%
get_AdditionalUnattendContent()-100%100%
get_WinRM()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-57.14%58.33%
DeserializeWindowsConfiguration(...)-48.39%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\WindowsConfiguration.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.Compute.Models
 11{
 12    /// <summary> Specifies Windows operating system settings on the virtual machine. </summary>
 13    public partial class WindowsConfiguration
 14    {
 15        /// <summary> Initializes a new instance of WindowsConfiguration. </summary>
 016        public WindowsConfiguration()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of WindowsConfiguration. </summary>
 21        /// <param name="provisionVMAgent"> Indicates whether virtual machine agent should be provisioned on the virtual
 22        /// <param name="enableAutomaticUpdates"> Indicates whether Automatic Updates is enabled for the Windows virtual
 23        /// <param name="timeZone"> Specifies the time zone of the virtual machine. e.g. &quot;Pacific Standard Time&quo
 24        /// <param name="additionalUnattendContent"> Specifies additional base-64 encoded XML formatted information that
 25        /// <param name="winRM"> Specifies the Windows Remote Management listeners. This enables remote Windows PowerShe
 85626        internal WindowsConfiguration(bool? provisionVMAgent, bool? enableAutomaticUpdates, string timeZone, IList<Addit
 27        {
 85628            ProvisionVMAgent = provisionVMAgent;
 85629            EnableAutomaticUpdates = enableAutomaticUpdates;
 85630            TimeZone = timeZone;
 85631            AdditionalUnattendContent = additionalUnattendContent;
 85632            WinRM = winRM;
 85633        }
 34
 35        /// <summary> Indicates whether virtual machine agent should be provisioned on the virtual machine. &lt;br&gt;&l
 87236        public bool? ProvisionVMAgent { get; set; }
 37        /// <summary> Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is t
 87238        public bool? EnableAutomaticUpdates { get; set; }
 39        /// <summary> Specifies the time zone of the virtual machine. e.g. &quot;Pacific Standard Time&quot;. &lt;br&gt;
 86440        public string TimeZone { get; set; }
 41        /// <summary> Specifies additional base-64 encoded XML formatted information that can be included in the Unatten
 86442        public IList<AdditionalUnattendContent> AdditionalUnattendContent { get; set; }
 43        /// <summary> Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. </summa
 86444        public WinRMConfiguration WinRM { get; set; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\WindowsConfiguration.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.Compute.Models
 13{
 14    public partial class WindowsConfiguration : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 818            writer.WriteStartObject();
 819            if (ProvisionVMAgent != null)
 20            {
 821                writer.WritePropertyName("provisionVMAgent");
 822                writer.WriteBooleanValue(ProvisionVMAgent.Value);
 23            }
 824            if (EnableAutomaticUpdates != null)
 25            {
 826                writer.WritePropertyName("enableAutomaticUpdates");
 827                writer.WriteBooleanValue(EnableAutomaticUpdates.Value);
 28            }
 829            if (TimeZone != null)
 30            {
 031                writer.WritePropertyName("timeZone");
 032                writer.WriteStringValue(TimeZone);
 33            }
 834            if (AdditionalUnattendContent != null)
 35            {
 036                writer.WritePropertyName("additionalUnattendContent");
 037                writer.WriteStartArray();
 038                foreach (var item in AdditionalUnattendContent)
 39                {
 040                    writer.WriteObjectValue(item);
 41                }
 042                writer.WriteEndArray();
 43            }
 844            if (WinRM != null)
 45            {
 046                writer.WritePropertyName("winRM");
 047                writer.WriteObjectValue(WinRM);
 48            }
 849            writer.WriteEndObject();
 850        }
 51
 52        internal static WindowsConfiguration DeserializeWindowsConfiguration(JsonElement element)
 53        {
 85654            bool? provisionVMAgent = default;
 85655            bool? enableAutomaticUpdates = default;
 85656            string timeZone = default;
 85657            IList<AdditionalUnattendContent> additionalUnattendContent = default;
 85658            WinRMConfiguration winRM = default;
 513659            foreach (var property in element.EnumerateObject())
 60            {
 171261                if (property.NameEquals("provisionVMAgent"))
 62                {
 85663                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 85667                    provisionVMAgent = property.Value.GetBoolean();
 85668                    continue;
 69                }
 85670                if (property.NameEquals("enableAutomaticUpdates"))
 71                {
 85672                    if (property.Value.ValueKind == JsonValueKind.Null)
 73                    {
 74                        continue;
 75                    }
 85676                    enableAutomaticUpdates = property.Value.GetBoolean();
 85677                    continue;
 78                }
 079                if (property.NameEquals("timeZone"))
 80                {
 081                    if (property.Value.ValueKind == JsonValueKind.Null)
 82                    {
 83                        continue;
 84                    }
 085                    timeZone = property.Value.GetString();
 086                    continue;
 87                }
 088                if (property.NameEquals("additionalUnattendContent"))
 89                {
 090                    if (property.Value.ValueKind == JsonValueKind.Null)
 91                    {
 92                        continue;
 93                    }
 094                    List<AdditionalUnattendContent> array = new List<AdditionalUnattendContent>();
 095                    foreach (var item in property.Value.EnumerateArray())
 96                    {
 097                        if (item.ValueKind == JsonValueKind.Null)
 98                        {
 099                            array.Add(null);
 100                        }
 101                        else
 102                        {
 0103                            array.Add(Models.AdditionalUnattendContent.DeserializeAdditionalUnattendContent(item));
 104                        }
 105                    }
 0106                    additionalUnattendContent = array;
 0107                    continue;
 108                }
 0109                if (property.NameEquals("winRM"))
 110                {
 0111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 0115                    winRM = WinRMConfiguration.DeserializeWinRMConfiguration(property.Value);
 116                    continue;
 117                }
 118            }
 856119            return new WindowsConfiguration(provisionVMAgent, enableAutomaticUpdates, timeZone, additionalUnattendConten
 120        }
 121    }
 122}