< Summary

Class:Microsoft.Azure.Batch.ExitCodeMapping
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ExitCodeMapping.cs
Covered lines:24
Uncovered lines:12
Coverable lines:36
Total lines:140
Line coverage:66.6% (24 of 36)
Covered branches:0
Total branches:0

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ExitCodeMapping.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    /// A process exit code and how the Batch service should respond if a task exits with that exit code.
 22    /// </summary>
 23    public partial class ExitCodeMapping : ITransportObjectProvider<Models.ExitCodeMapping>, IPropertyMetadata
 24    {
 25        #region Constructors
 26        /// <summary>
 27        /// Initializes a new instance of the <see cref="ExitCodeMapping"/> class.
 28        /// </summary>
 29        /// <param name='code'>The process exit code.</param>
 30        /// <param name='exitOptions'>How the Batch service should respond if the task exits with this exit code.</param
 45131        public ExitCodeMapping(
 45132            int code,
 45133            ExitOptions exitOptions)
 34        {
 45135            this.Code = code;
 45136            this.ExitOptions = exitOptions;
 45137        }
 38
 122039        internal ExitCodeMapping(Models.ExitCodeMapping protocolObject)
 40        {
 122041            this.Code = protocolObject.Code;
 178542            this.ExitOptions = UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ExitOptions, o => new ExitOpti
 122043        }
 44
 45        #endregion Constructors
 46
 47        #region ExitCodeMapping
 48
 49        /// <summary>
 50        /// Gets the process exit code.
 51        /// </summary>
 211952        public int Code { get; }
 53
 54        /// <summary>
 55        /// Gets how the Batch service should respond if the task exits with this exit code.
 56        /// </summary>
 211957        public ExitOptions ExitOptions { get; }
 58
 59        #endregion // ExitCodeMapping
 60
 61        #region IPropertyMetadata
 62
 63        bool IModifiable.HasBeenModified
 64        {
 65            //This class is compile time readonly so it cannot have been modified
 066            get { return false; }
 67        }
 68
 69        bool IReadOnly.IsReadOnly
 70        {
 071            get { return true; }
 72            set
 73            {
 74                // This class is compile time readonly already
 523275            }
 76        }
 77
 78        #endregion // IPropertyMetadata
 79
 80        #region Internal/private methods
 81
 82        /// <summary>
 83        /// Return a protocol object of the requested type.
 84        /// </summary>
 85        /// <returns>The protocol object of the requested type.</returns>
 86        Models.ExitCodeMapping ITransportObjectProvider<Models.ExitCodeMapping>.GetTransportObject()
 87        {
 45088            Models.ExitCodeMapping result = new Models.ExitCodeMapping()
 45089            {
 45090                Code = this.Code,
 90091                ExitOptions = UtilitiesInternal.CreateObjectWithNullCheck(this.ExitOptions, (o) => o.GetTransportObject(
 45092            };
 93
 45094            return result;
 95        }
 96
 97        /// <summary>
 98        /// Converts a collection of protocol layer objects to object layer collection objects.
 99        /// </summary>
 100        internal static IList<ExitCodeMapping> ConvertFromProtocolCollection(IEnumerable<Models.ExitCodeMapping> protoCo
 101        {
 0102            ConcurrentChangeTrackedModifiableList<ExitCodeMapping> converted = UtilitiesInternal.CollectionToThreadSafeC
 0103                items: protoCollection,
 0104                objectCreationFunc: o => new ExitCodeMapping(o));
 105
 0106            return converted;
 107        }
 108
 109        /// <summary>
 110        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
 111        /// </summary>
 112        internal static IList<ExitCodeMapping> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.ExitCodeMapping
 113        {
 504114            ConcurrentChangeTrackedModifiableList<ExitCodeMapping> converted = UtilitiesInternal.CollectionToThreadSafeC
 504115                items: protoCollection,
 1724116                objectCreationFunc: o => new ExitCodeMapping(o).Freeze());
 117
 771118            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());
 119
 504120            return converted;
 121        }
 122
 123        /// <summary>
 124        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked 
 125        /// and returned as a readonly collection.
 126        /// </summary>
 127        internal static IReadOnlyList<ExitCodeMapping> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.ExitCode
 128        {
 0129            IReadOnlyList<ExitCodeMapping> converted =
 0130                UtilitiesInternal.CreateObjectWithNullCheck(
 0131                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 0132                        items: protoCollection,
 0133                        objectCreationFunc: o => new ExitCodeMapping(o).Freeze()), o => o.AsReadOnly());
 134
 0135            return converted;
 136        }
 137
 138        #endregion // Internal/private methods
 139    }
 140}