< Summary

Class:Azure.ResourceManager.Resources.Models.WhatIfPropertyChange
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfPropertyChange.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfPropertyChange.Serialization.cs
Covered lines:32
Uncovered lines:15
Coverable lines:47
Total lines:134
Line coverage:68% (32 of 47)
Covered branches:15
Total branches:24
Branch coverage:62.5% (15 of 24)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Path()-100%100%
get_PropertyChangeType()-100%100%
get_Before()-100%100%
get_After()-100%100%
get_Children()-0%100%
DeserializeWhatIfPropertyChange(...)-72.41%68.18%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfPropertyChange.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Resources.Models
 12{
 13    /// <summary> The predicted change to the resource property. </summary>
 14    public partial class WhatIfPropertyChange
 15    {
 16        /// <summary> Initializes a new instance of WhatIfPropertyChange. </summary>
 17        /// <param name="path"> The path of the property. </param>
 18        /// <param name="propertyChangeType"> The type of property change. </param>
 019        internal WhatIfPropertyChange(string path, PropertyChangeType propertyChangeType)
 20        {
 021            if (path == null)
 22            {
 023                throw new ArgumentNullException(nameof(path));
 24            }
 25
 026            Path = path;
 027            PropertyChangeType = propertyChangeType;
 028        }
 29
 30        /// <summary> Initializes a new instance of WhatIfPropertyChange. </summary>
 31        /// <param name="path"> The path of the property. </param>
 32        /// <param name="propertyChangeType"> The type of property change. </param>
 33        /// <param name="before"> The value of the property before the deployment is executed. </param>
 34        /// <param name="after"> The value of the property after the deployment is executed. </param>
 35        /// <param name="children"> Nested property changes. </param>
 2036        internal WhatIfPropertyChange(string path, PropertyChangeType propertyChangeType, object before, object after, I
 37        {
 2038            Path = path;
 2039            PropertyChangeType = propertyChangeType;
 2040            Before = before;
 2041            After = after;
 2042            Children = children;
 2043        }
 44
 45        /// <summary> The path of the property. </summary>
 1246        public string Path { get; }
 47        /// <summary> The type of property change. </summary>
 848        public PropertyChangeType PropertyChangeType { get; }
 49        /// <summary> The value of the property before the deployment is executed. </summary>
 850        public object Before { get; }
 51        /// <summary> The value of the property after the deployment is executed. </summary>
 1252        public object After { get; }
 53        /// <summary> Nested property changes. </summary>
 054        public IReadOnlyList<WhatIfPropertyChange> Children { get; }
 55    }
 56}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfPropertyChange.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 WhatIfPropertyChange
 15    {
 16        internal static WhatIfPropertyChange DeserializeWhatIfPropertyChange(JsonElement element)
 17        {
 2018            string path = default;
 2019            PropertyChangeType propertyChangeType = default;
 2020            object before = default;
 2021            object after = default;
 2022            IReadOnlyList<WhatIfPropertyChange> children = default;
 17623            foreach (var property in element.EnumerateObject())
 24            {
 6825                if (property.NameEquals("path"))
 26                {
 2027                    path = property.Value.GetString();
 2028                    continue;
 29                }
 4830                if (property.NameEquals("propertyChangeType"))
 31                {
 2032                    propertyChangeType = property.Value.GetString().ToPropertyChangeType();
 2033                    continue;
 34                }
 2835                if (property.NameEquals("before"))
 36                {
 837                    if (property.Value.ValueKind == JsonValueKind.Null)
 38                    {
 39                        continue;
 40                    }
 841                    before = property.Value.GetObject();
 842                    continue;
 43                }
 2044                if (property.NameEquals("after"))
 45                {
 2046                    if (property.Value.ValueKind == JsonValueKind.Null)
 47                    {
 48                        continue;
 49                    }
 2050                    after = property.Value.GetObject();
 2051                    continue;
 52                }
 053                if (property.NameEquals("children"))
 54                {
 055                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 059                    List<WhatIfPropertyChange> array = new List<WhatIfPropertyChange>();
 060                    foreach (var item in property.Value.EnumerateArray())
 61                    {
 062                        if (item.ValueKind == JsonValueKind.Null)
 63                        {
 064                            array.Add(null);
 65                        }
 66                        else
 67                        {
 068                            array.Add(DeserializeWhatIfPropertyChange(item));
 69                        }
 70                    }
 071                    children = array;
 72                    continue;
 73                }
 74            }
 2075            return new WhatIfPropertyChange(path, propertyChangeType, before, after, children);
 76        }
 77    }
 78}