< Summary

Class:Microsoft.Azure.Batch.NameValuePair
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\NameValuePair.cs
Covered lines:13
Uncovered lines:11
Coverable lines:24
Total lines:114
Line coverage:54.1% (13 of 24)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.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%
ConvertFromProtocolCollection(...)-0%100%
ConvertFromProtocolCollectionAndFreeze(...)-0%100%
ConvertFromProtocolCollectionReadOnly(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\NameValuePair.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    /// Represents a name-value pair.
 22    /// </summary>
 23    public partial class NameValuePair : IPropertyMetadata
 24    {
 25        #region Constructors
 26
 1615927        internal NameValuePair(Models.NameValuePair protocolObject)
 28        {
 1615929            this.Name = protocolObject.Name;
 1615930            this.Value = protocolObject.Value;
 1615931        }
 32
 33        #endregion Constructors
 34
 35        #region NameValuePair
 36
 37        /// <summary>
 38        /// Gets the name in the name-value pair.
 39        /// </summary>
 1612140        public string Name { get; }
 41
 42        /// <summary>
 43        /// Gets the value in the name-value pair.
 44        /// </summary>
 1612145        public string Value { get; }
 46
 47        #endregion // NameValuePair
 48
 49        #region IPropertyMetadata
 50
 51        bool IModifiable.HasBeenModified
 52        {
 53            //This class is compile time readonly so it cannot have been modified
 054            get { return false; }
 55        }
 56
 57        bool IReadOnly.IsReadOnly
 58        {
 059            get { return true; }
 60            set
 61            {
 62                // This class is compile time readonly already
 1615963            }
 64        }
 65
 66        #endregion // IPropertyMetadata
 67
 68        #region Internal/private methods
 69
 70
 71        /// <summary>
 72        /// Converts a collection of protocol layer objects to object layer collection objects.
 73        /// </summary>
 74        internal static IList<NameValuePair> ConvertFromProtocolCollection(IEnumerable<Models.NameValuePair> protoCollec
 75        {
 076            ConcurrentChangeTrackedModifiableList<NameValuePair> converted = UtilitiesInternal.CollectionToThreadSafeCol
 077                items: protoCollection,
 078                objectCreationFunc: o => new NameValuePair(o));
 79
 080            return converted;
 81        }
 82
 83        /// <summary>
 84        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
 85        /// </summary>
 86        internal static IList<NameValuePair> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.NameValuePair> pr
 87        {
 088            ConcurrentChangeTrackedModifiableList<NameValuePair> converted = UtilitiesInternal.CollectionToThreadSafeCol
 089                items: protoCollection,
 090                objectCreationFunc: o => new NameValuePair(o).Freeze());
 91
 092            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());
 93
 094            return converted;
 95        }
 96
 97        /// <summary>
 98        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked 
 99        /// and returned as a readonly collection.
 100        /// </summary>
 101        internal static IReadOnlyList<NameValuePair> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.NameValueP
 102        {
 7195103            IReadOnlyList<NameValuePair> converted =
 7195104                UtilitiesInternal.CreateObjectWithNullCheck(
 7195105                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 7195106                        items: protoCollection,
 26919107                        objectCreationFunc: o => new NameValuePair(o).Freeze()), o => o.AsReadOnly());
 108
 7195109            return converted;
 110        }
 111
 112        #endregion // Internal/private methods
 113    }
 114}