< Summary

Class:Microsoft.Azure.Batch.ComputeNodeError
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ComputeNodeError.cs
Covered lines:15
Uncovered lines:11
Coverable lines:26
Total lines:120
Line coverage:57.6% (15 of 26)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_Code()-100%100%
get_ErrorDetails()-100%100%
get_Message()-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\ComputeNodeError.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 error encountered by an Azure Batch compute node.
 22    /// </summary>
 23    public partial class ComputeNodeError : IPropertyMetadata
 24    {
 25        #region Constructors
 26
 222627        internal ComputeNodeError(Models.ComputeNodeError protocolObject)
 28        {
 222629            this.Code = protocolObject.Code;
 222630            this.ErrorDetails = NameValuePair.ConvertFromProtocolCollectionReadOnly(protocolObject.ErrorDetails);
 222631            this.Message = protocolObject.Message;
 222632        }
 33
 34        #endregion Constructors
 35
 36        #region ComputeNodeError
 37
 38        /// <summary>
 39        /// Gets a code for the compute node error. See <see cref="Common.BatchErrorCodeStrings"/> for possible values.
 40        /// </summary>
 222641        public string Code { get; }
 42
 43        /// <summary>
 44        /// Gets a list of additional error details related to the compute node error.
 45        /// </summary>
 222646        public IReadOnlyList<NameValuePair> ErrorDetails { get; }
 47
 48        /// <summary>
 49        /// Gets a message describing the compute node error, intended to be suitable for display in a user interface.
 50        /// </summary>
 222651        public string Message { get; }
 52
 53        #endregion // ComputeNodeError
 54
 55        #region IPropertyMetadata
 56
 57        bool IModifiable.HasBeenModified
 58        {
 59            //This class is compile time readonly so it cannot have been modified
 060            get { return false; }
 61        }
 62
 63        bool IReadOnly.IsReadOnly
 64        {
 065            get { return true; }
 66            set
 67            {
 68                // This class is compile time readonly already
 222669            }
 70        }
 71
 72        #endregion // IPropertyMetadata
 73
 74        #region Internal/private methods
 75
 76
 77        /// <summary>
 78        /// Converts a collection of protocol layer objects to object layer collection objects.
 79        /// </summary>
 80        internal static IList<ComputeNodeError> ConvertFromProtocolCollection(IEnumerable<Models.ComputeNodeError> proto
 81        {
 082            ConcurrentChangeTrackedModifiableList<ComputeNodeError> converted = UtilitiesInternal.CollectionToThreadSafe
 083                items: protoCollection,
 084                objectCreationFunc: o => new ComputeNodeError(o));
 85
 086            return converted;
 87        }
 88
 89        /// <summary>
 90        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
 91        /// </summary>
 92        internal static IList<ComputeNodeError> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.ComputeNodeErr
 93        {
 094            ConcurrentChangeTrackedModifiableList<ComputeNodeError> converted = UtilitiesInternal.CollectionToThreadSafe
 095                items: protoCollection,
 096                objectCreationFunc: o => new ComputeNodeError(o).Freeze());
 97
 098            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());
 99
 0100            return converted;
 101        }
 102
 103        /// <summary>
 104        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked 
 105        /// and returned as a readonly collection.
 106        /// </summary>
 107        internal static IReadOnlyList<ComputeNodeError> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.Compute
 108        {
 1003109            IReadOnlyList<ComputeNodeError> converted =
 1003110                UtilitiesInternal.CreateObjectWithNullCheck(
 1003111                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 1003112                        items: protoCollection,
 3723113                        objectCreationFunc: o => new ComputeNodeError(o).Freeze()), o => o.AsReadOnly());
 114
 1003115            return converted;
 116        }
 117
 118        #endregion // Internal/private methods
 119    }
 120}