< Summary

Class:Azure.ResourceManager.Resources.Models.WhatIfOperationResult
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfOperationResult.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfOperationResult.Serialization.cs
Covered lines:26
Uncovered lines:7
Coverable lines:33
Total lines:111
Line coverage:78.7% (26 of 33)
Covered branches:19
Total branches:22
Branch coverage:86.3% (19 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Status()-100%100%
get_Error()-0%100%
get_Changes()-100%100%
DeserializeWhatIfOperationResult(...)-82.61%86.36%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfOperationResult.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> Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the nex
 13    public partial class WhatIfOperationResult
 14    {
 15        /// <summary> Initializes a new instance of WhatIfOperationResult. </summary>
 016        internal WhatIfOperationResult()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of WhatIfOperationResult. </summary>
 21        /// <param name="status"> Status of the What-If operation. </param>
 22        /// <param name="error"> Error when What-If operation fails. </param>
 23        /// <param name="changes"> List of resource changes predicted by What-If operation. </param>
 4424        internal WhatIfOperationResult(string status, ErrorResponse error, IReadOnlyList<WhatIfChange> changes)
 25        {
 4426            Status = status;
 4427            Error = error;
 4428            Changes = changes;
 4429        }
 30
 31        /// <summary> Status of the What-If operation. </summary>
 4432        public string Status { get; }
 33        /// <summary> Error when What-If operation fails. </summary>
 034        public ErrorResponse Error { get; }
 35        /// <summary> List of resource changes predicted by What-If operation. </summary>
 12436        public IReadOnlyList<WhatIfChange> Changes { get; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfOperationResult.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 WhatIfOperationResult
 15    {
 16        internal static WhatIfOperationResult DeserializeWhatIfOperationResult(JsonElement element)
 17        {
 4418            string status = default;
 4419            ErrorResponse error = default;
 4420            IReadOnlyList<WhatIfChange> changes = default;
 26421            foreach (var property in element.EnumerateObject())
 22            {
 8823                if (property.NameEquals("status"))
 24                {
 4425                    if (property.Value.ValueKind == JsonValueKind.Null)
 26                    {
 27                        continue;
 28                    }
 4429                    status = property.Value.GetString();
 4430                    continue;
 31                }
 4432                if (property.NameEquals("error"))
 33                {
 034                    if (property.Value.ValueKind == JsonValueKind.Null)
 35                    {
 36                        continue;
 37                    }
 038                    error = ErrorResponse.DeserializeErrorResponse(property.Value);
 039                    continue;
 40                }
 4441                if (property.NameEquals("properties"))
 42                {
 17643                    foreach (var property0 in property.Value.EnumerateObject())
 44                    {
 4445                        if (property0.NameEquals("changes"))
 46                        {
 4447                            if (property0.Value.ValueKind == JsonValueKind.Null)
 48                            {
 49                                continue;
 50                            }
 4451                            List<WhatIfChange> array = new List<WhatIfChange>();
 21652                            foreach (var item in property0.Value.EnumerateArray())
 53                            {
 6454                                if (item.ValueKind == JsonValueKind.Null)
 55                                {
 056                                    array.Add(null);
 57                                }
 58                                else
 59                                {
 6460                                    array.Add(WhatIfChange.DeserializeWhatIfChange(item));
 61                                }
 62                            }
 4463                            changes = array;
 64                            continue;
 65                        }
 66                    }
 67                    continue;
 68                }
 69            }
 4470            return new WhatIfOperationResult(status, error, changes);
 71        }
 72    }
 73}