< Summary

Class:Microsoft.Azure.Batch.BatchErrorDetail
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\BatchErrorDetail.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_Key()-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\BatchErrorDetail.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 item of additional information included in a <see cref="BatchError"/>.
 22    /// </summary>
 23    public partial class BatchErrorDetail : IPropertyMetadata
 24    {
 25        #region Constructors
 26
 227        internal BatchErrorDetail(Models.BatchErrorDetail protocolObject)
 28        {
 229            this.Key = protocolObject.Key;
 230            this.Value = protocolObject.Value;
 231        }
 32
 33        #endregion Constructors
 34
 35        #region BatchErrorDetail
 36
 37        /// <summary>
 38        /// Gets an identifier specifying the meaning of the <see cref="Value"/> property.
 39        /// </summary>
 240        public string Key { get; }
 41
 42        /// <summary>
 43        /// Gets the additional information included with the <see cref="BatchError"/>.
 44        /// </summary>
 245        public string Value { get; }
 46
 47        #endregion // BatchErrorDetail
 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
 263            }
 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<BatchErrorDetail> ConvertFromProtocolCollection(IEnumerable<Models.BatchErrorDetail> proto
 75        {
 076            ConcurrentChangeTrackedModifiableList<BatchErrorDetail> converted = UtilitiesInternal.CollectionToThreadSafe
 077                items: protoCollection,
 078                objectCreationFunc: o => new BatchErrorDetail(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<BatchErrorDetail> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.BatchErrorDeta
 87        {
 088            ConcurrentChangeTrackedModifiableList<BatchErrorDetail> converted = UtilitiesInternal.CollectionToThreadSafe
 089                items: protoCollection,
 090                objectCreationFunc: o => new BatchErrorDetail(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<BatchErrorDetail> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.BatchEr
 102        {
 3103            IReadOnlyList<BatchErrorDetail> converted =
 3104                UtilitiesInternal.CreateObjectWithNullCheck(
 3105                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 3106                        items: protoCollection,
 5107                        objectCreationFunc: o => new BatchErrorDetail(o).Freeze()), o => o.AsReadOnly());
 108
 3109            return converted;
 110        }
 111
 112        #endregion // Internal/private methods
 113    }
 114}