< Summary

Class:Azure.ResourceManager.Resources.Models.EnvironmentVariable
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\EnvironmentVariable.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\EnvironmentVariable.Serialization.cs
Covered lines:0
Uncovered lines:39
Coverable lines:39
Total lines:112
Line coverage:0% (0 of 39)
Covered branches:0
Total branches:18
Branch coverage:0% (0 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_Value()-0%100%
get_SecureValue()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeEnvironmentVariable(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\EnvironmentVariable.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.Resources.Models
 11{
 12    /// <summary> The environment variable to pass to the script in the container instance. </summary>
 13    public partial class EnvironmentVariable
 14    {
 15        /// <summary> Initializes a new instance of EnvironmentVariable. </summary>
 16        /// <param name="name"> The name of the environment variable. </param>
 017        public EnvironmentVariable(string name)
 18        {
 019            if (name == null)
 20            {
 021                throw new ArgumentNullException(nameof(name));
 22            }
 23
 024            Name = name;
 025        }
 26
 27        /// <summary> Initializes a new instance of EnvironmentVariable. </summary>
 28        /// <param name="name"> The name of the environment variable. </param>
 29        /// <param name="value"> The value of the environment variable. </param>
 30        /// <param name="secureValue"> The value of the secure environment variable. </param>
 031        internal EnvironmentVariable(string name, string value, string secureValue)
 32        {
 033            Name = name;
 034            Value = value;
 035            SecureValue = secureValue;
 036        }
 37
 38        /// <summary> The name of the environment variable. </summary>
 039        public string Name { get; set; }
 40        /// <summary> The value of the environment variable. </summary>
 041        public string Value { get; set; }
 42        /// <summary> The value of the secure environment variable. </summary>
 043        public string SecureValue { get; set; }
 44    }
 45}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\EnvironmentVariable.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.Resources.Models
 12{
 13    public partial class EnvironmentVariable : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("name");
 019            writer.WriteStringValue(Name);
 020            if (Value != null)
 21            {
 022                writer.WritePropertyName("value");
 023                writer.WriteStringValue(Value);
 24            }
 025            if (SecureValue != null)
 26            {
 027                writer.WritePropertyName("secureValue");
 028                writer.WriteStringValue(SecureValue);
 29            }
 030            writer.WriteEndObject();
 031        }
 32
 33        internal static EnvironmentVariable DeserializeEnvironmentVariable(JsonElement element)
 34        {
 035            string name = default;
 036            string value = default;
 037            string secureValue = default;
 038            foreach (var property in element.EnumerateObject())
 39            {
 040                if (property.NameEquals("name"))
 41                {
 042                    name = property.Value.GetString();
 043                    continue;
 44                }
 045                if (property.NameEquals("value"))
 46                {
 047                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 051                    value = property.Value.GetString();
 052                    continue;
 53                }
 054                if (property.NameEquals("secureValue"))
 55                {
 056                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 060                    secureValue = property.Value.GetString();
 61                    continue;
 62                }
 63            }
 064            return new EnvironmentVariable(name, value, secureValue);
 65        }
 66    }
 67}