< Summary

Class:Azure.ResourceManager.Storage.Models.CorsRules
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CorsRules.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CorsRules.Serialization.cs
Covered lines:25
Uncovered lines:1
Coverable lines:26
Total lines:92
Line coverage:96.1% (25 of 26)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_CorsRulesValue()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeCorsRules(...)-90.91%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CorsRules.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.Storage.Models
 11{
 12    /// <summary> Sets the CORS rules. You can include up to five CorsRule elements in the request. </summary>
 13    public partial class CorsRules
 14    {
 15        /// <summary> Initializes a new instance of CorsRules. </summary>
 816        public CorsRules()
 17        {
 818        }
 19
 20        /// <summary> Initializes a new instance of CorsRules. </summary>
 21        /// <param name="corsRulesValue"> The List of CORS rules. You can include up to five CorsRule elements in the re
 6422        internal CorsRules(IList<CorsRule> corsRulesValue)
 23        {
 6424            CorsRulesValue = corsRulesValue;
 6425        }
 26
 27        /// <summary> The List of CORS rules. You can include up to five CorsRule elements in the request. </summary>
 32028        public IList<CorsRule> CorsRulesValue { get; set; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CorsRules.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.Storage.Models
 13{
 14    public partial class CorsRules : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 2018            writer.WriteStartObject();
 2019            if (CorsRulesValue != null)
 20            {
 2021                writer.WritePropertyName("corsRules");
 2022                writer.WriteStartArray();
 8823                foreach (var item in CorsRulesValue)
 24                {
 2425                    writer.WriteObjectValue(item);
 26                }
 2027                writer.WriteEndArray();
 28            }
 2029            writer.WriteEndObject();
 2030        }
 31
 32        internal static CorsRules DeserializeCorsRules(JsonElement element)
 33        {
 6434            IList<CorsRule> corsRules = default;
 25635            foreach (var property in element.EnumerateObject())
 36            {
 6437                if (property.NameEquals("corsRules"))
 38                {
 6439                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 6443                    List<CorsRule> array = new List<CorsRule>();
 22444                    foreach (var item in property.Value.EnumerateArray())
 45                    {
 4846                        if (item.ValueKind == JsonValueKind.Null)
 47                        {
 048                            array.Add(null);
 49                        }
 50                        else
 51                        {
 4852                            array.Add(CorsRule.DeserializeCorsRule(item));
 53                        }
 54                    }
 6455                    corsRules = array;
 56                    continue;
 57                }
 58            }
 6459            return new CorsRules(corsRules);
 60        }
 61    }
 62}