< Summary

Class:Microsoft.Azure.Batch.EnvironmentSetting
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\EnvironmentSetting.cs
Covered lines:28
Uncovered lines:8
Coverable lines:36
Total lines:141
Line coverage:77.7% (28 of 36)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Value()-100%100%
Microsoft.Azure.Batch.IModifiable.get_HasBeenModified()-0%100%
Microsoft.Azure.Batch.IReadOnly.get_IsReadOnly()-0%100%
Microsoft.Azure.Batch.IReadOnly.set_IsReadOnly(...)-100%100%
Microsoft.Azure.Batch.ITransportObjectProvider<Microsoft.Azure.Batch.Protocol.Models.EnvironmentSetting>.GetTransportObject()-100%100%
ConvertFromProtocolCollection(...)-100%100%
ConvertFromProtocolCollectionAndFreeze(...)-100%100%
ConvertFromProtocolCollectionReadOnly(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\EnvironmentSetting.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for license information.
 3//
 4// Code generated by Microsoft (R) AutoRest Code Generator.
 5// Changes may cause incorrect behavior and will be lost if the code is
 6// regenerated.
 7
 8//
 9// This file was autogenerated by a tool.
 10// Do not modify it.
 11//
 12
 13namespace Microsoft.Azure.Batch
 14{
 15    using Models = Microsoft.Azure.Batch.Protocol.Models;
 16    using System;
 17    using System.Collections.Generic;
 18    using System.Linq;
 19
 20    /// <summary>
 21    /// An environment variable to be set on a task process, such as a job task, start task, job manager task, or job pr
 22    /// or release task.
 23    /// </summary>
 24    public partial class EnvironmentSetting : ITransportObjectProvider<Models.EnvironmentSetting>, IPropertyMetadata
 25    {
 26        #region Constructors
 27        /// <summary>
 28        /// Initializes a new instance of the <see cref="EnvironmentSetting"/> class.
 29        /// </summary>
 30        /// <param name='name'>The name of the environment variable.</param>
 31        /// <param name='value'>The value of the environment variable.</param>
 278332        public EnvironmentSetting(
 278333            string name,
 278334            string value)
 35        {
 278336            this.Name = name;
 278337            this.Value = value;
 278338        }
 39
 1286740        internal EnvironmentSetting(Models.EnvironmentSetting protocolObject)
 41        {
 1286742            this.Name = protocolObject.Name;
 1286743            this.Value = protocolObject.Value;
 1286744        }
 45
 46        #endregion Constructors
 47
 48        #region EnvironmentSetting
 49
 50        /// <summary>
 51        /// Gets the name of the environment variable.
 52        /// </summary>
 1843253        public string Name { get; }
 54
 55        /// <summary>
 56        /// Gets the value of the environment variable.
 57        /// </summary>
 1843258        public string Value { get; }
 59
 60        #endregion // EnvironmentSetting
 61
 62        #region IPropertyMetadata
 63
 64        bool IModifiable.HasBeenModified
 65        {
 66            //This class is compile time readonly so it cannot have been modified
 067            get { return false; }
 68        }
 69
 70        bool IReadOnly.IsReadOnly
 71        {
 072            get { return true; }
 73            set
 74            {
 75                // This class is compile time readonly already
 2863576            }
 77        }
 78
 79        #endregion // IPropertyMetadata
 80
 81        #region Internal/private methods
 82
 83        /// <summary>
 84        /// Return a protocol object of the requested type.
 85        /// </summary>
 86        /// <returns>The protocol object of the requested type.</returns>
 87        Models.EnvironmentSetting ITransportObjectProvider<Models.EnvironmentSetting>.GetTransportObject()
 88        {
 278289            Models.EnvironmentSetting result = new Models.EnvironmentSetting()
 278290            {
 278291                Name = this.Name,
 278292                Value = this.Value,
 278293            };
 94
 278295            return result;
 96        }
 97
 98        /// <summary>
 99        /// Converts a collection of protocol layer objects to object layer collection objects.
 100        /// </summary>
 101        internal static IList<EnvironmentSetting> ConvertFromProtocolCollection(IEnumerable<Models.EnvironmentSetting> p
 102        {
 3804103            ConcurrentChangeTrackedModifiableList<EnvironmentSetting> converted = UtilitiesInternal.CollectionToThreadSa
 3804104                items: protoCollection,
 12373105                objectCreationFunc: o => new EnvironmentSetting(o));
 106
 3804107            return converted;
 108        }
 109
 110        /// <summary>
 111        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
 112        /// </summary>
 113        internal static IList<EnvironmentSetting> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.EnvironmentS
 114        {
 2037115            ConcurrentChangeTrackedModifiableList<EnvironmentSetting> converted = UtilitiesInternal.CollectionToThreadSa
 2037116                items: protoCollection,
 6335117                objectCreationFunc: o => new EnvironmentSetting(o).Freeze());
 118
 3010119            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());
 120
 2037121            return converted;
 122        }
 123
 124        /// <summary>
 125        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked 
 126        /// and returned as a readonly collection.
 127        /// </summary>
 128        internal static IReadOnlyList<EnvironmentSetting> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.Envir
 129        {
 0130            IReadOnlyList<EnvironmentSetting> converted =
 0131                UtilitiesInternal.CreateObjectWithNullCheck(
 0132                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 0133                        items: protoCollection,
 0134                        objectCreationFunc: o => new EnvironmentSetting(o).Freeze()), o => o.AsReadOnly());
 135
 0136            return converted;
 137        }
 138
 139        #endregion // Internal/private methods
 140    }
 141}