< Summary

Class:Microsoft.Azure.Batch.ExitOptions
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ExitOptions.cs
Covered lines:31
Uncovered lines:17
Coverable lines:48
Total lines:170
Line coverage:64.5% (31 of 48)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
get_DependencyAction()-100%100%
set_DependencyAction(...)-100%100%
get_JobAction()-100%100%
set_JobAction(...)-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.ExitOptions>.GetTransportObject()-100%100%
ConvertFromProtocolCollection(...)-0%100%
ConvertFromProtocolCollectionAndFreeze(...)-0%100%
ConvertFromProtocolCollectionReadOnly(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ExitOptions.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    /// How the Batch service should respond to a particular exit condition.
 22    /// </summary>
 23    public partial class ExitOptions : ITransportObjectProvider<Models.ExitOptions>, IPropertyMetadata
 24    {
 25        private class PropertyContainer : PropertyCollection
 26        {
 27            public readonly PropertyAccessor<Common.DependencyAction?> DependencyActionProperty;
 28            public readonly PropertyAccessor<Common.JobAction?> JobActionProperty;
 29
 126230            public PropertyContainer() : base(BindingState.Unbound)
 31            {
 126232                this.DependencyActionProperty = this.CreatePropertyAccessor<Common.DependencyAction?>(nameof(DependencyA
 126233                this.JobActionProperty = this.CreatePropertyAccessor<Common.JobAction?>(nameof(JobAction), BindingAccess
 126234            }
 35
 194436            public PropertyContainer(Models.ExitOptions protocolObject) : base(BindingState.Bound)
 37            {
 194438                this.DependencyActionProperty = this.CreatePropertyAccessor(
 194439                    UtilitiesInternal.MapNullableEnum<Models.DependencyAction, Common.DependencyAction>(protocolObject.D
 194440                    nameof(DependencyAction),
 194441                    BindingAccess.Read);
 194442                this.JobActionProperty = this.CreatePropertyAccessor(
 194443                    UtilitiesInternal.MapNullableEnum<Models.JobAction, Common.JobAction>(protocolObject.JobAction),
 194444                    nameof(JobAction),
 194445                    BindingAccess.Read);
 194446            }
 47        }
 48
 49        private readonly PropertyContainer propertyContainer;
 50
 51        #region Constructors
 52
 53        /// <summary>
 54        /// Initializes a new instance of the <see cref="ExitOptions"/> class.
 55        /// </summary>
 126256        public ExitOptions()
 57        {
 126258            this.propertyContainer = new PropertyContainer();
 126259        }
 60
 194461        internal ExitOptions(Models.ExitOptions protocolObject)
 62        {
 194463            this.propertyContainer = new PropertyContainer(protocolObject);
 194464        }
 65
 66        #endregion Constructors
 67
 68        #region ExitOptions
 69
 70        /// <summary>
 71        /// Gets or sets an action that the Batch service should take on tasks that depend on this task.
 72        /// </summary>
 73        /// <remarks>
 74        /// The default is <see cref="Common.DependencyAction.Satisfy"/> for exit code 0, and <see cref="Common.Dependen
 75        /// for all other exit conditions. If the job's <see cref="CloudJob.UsesTaskDependencies"/> is false, you cannot
 76        /// add a task with this property set.
 77        /// </remarks>
 78        public Common.DependencyAction? DependencyAction
 79        {
 445380            get { return this.propertyContainer.DependencyActionProperty.Value; }
 123581            set { this.propertyContainer.DependencyActionProperty.Value = value; }
 82        }
 83
 84        /// <summary>
 85        /// Gets or sets an action to take on the job containing the task, if the task completes with the given exit con
 86        /// and the job's <see cref="CloudJob.OnTaskFailure"/> property is <see cref="Common.OnTaskFailure.PerformExitOp
 87        /// </summary>
 88        public Common.JobAction? JobAction
 89        {
 445290            get { return this.propertyContainer.JobActionProperty.Value; }
 129591            set { this.propertyContainer.JobActionProperty.Value = value; }
 92        }
 93
 94        #endregion // ExitOptions
 95
 96        #region IPropertyMetadata
 97
 98        bool IModifiable.HasBeenModified
 99        {
 0100            get { return this.propertyContainer.HasBeenModified; }
 101        }
 102
 103        bool IReadOnly.IsReadOnly
 104        {
 0105            get { return this.propertyContainer.IsReadOnly; }
 5452106            set { this.propertyContainer.IsReadOnly = value; }
 107        }
 108
 109        #endregion //IPropertyMetadata
 110
 111        #region Internal/private methods
 112        /// <summary>
 113        /// Return a protocol object of the requested type.
 114        /// </summary>
 115        /// <returns>The protocol object of the requested type.</returns>
 116        Models.ExitOptions ITransportObjectProvider<Models.ExitOptions>.GetTransportObject()
 117        {
 1258118            Models.ExitOptions result = new Models.ExitOptions()
 1258119            {
 1258120                DependencyAction = UtilitiesInternal.MapNullableEnum<Common.DependencyAction, Models.DependencyAction>(t
 1258121                JobAction = UtilitiesInternal.MapNullableEnum<Common.JobAction, Models.JobAction>(this.JobAction),
 1258122            };
 123
 1258124            return result;
 125        }
 126
 127        /// <summary>
 128        /// Converts a collection of protocol layer objects to object layer collection objects.
 129        /// </summary>
 130        internal static IList<ExitOptions> ConvertFromProtocolCollection(IEnumerable<Models.ExitOptions> protoCollection
 131        {
 0132            ConcurrentChangeTrackedModifiableList<ExitOptions> converted = UtilitiesInternal.CollectionToThreadSafeColle
 0133                items: protoCollection,
 0134                objectCreationFunc: o => new ExitOptions(o));
 135
 0136            return converted;
 137        }
 138
 139        /// <summary>
 140        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
 141        /// </summary>
 142        internal static IList<ExitOptions> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.ExitOptions> protoC
 143        {
 0144            ConcurrentChangeTrackedModifiableList<ExitOptions> converted = UtilitiesInternal.CollectionToThreadSafeColle
 0145                items: protoCollection,
 0146                objectCreationFunc: o => new ExitOptions(o).Freeze());
 147
 0148            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());
 149
 0150            return converted;
 151        }
 152
 153        /// <summary>
 154        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked 
 155        /// and returned as a readonly collection.
 156        /// </summary>
 157        internal static IReadOnlyList<ExitOptions> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.ExitOptions>
 158        {
 0159            IReadOnlyList<ExitOptions> converted =
 0160                UtilitiesInternal.CreateObjectWithNullCheck(
 0161                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 0162                        items: protoCollection,
 0163                        objectCreationFunc: o => new ExitOptions(o).Freeze()), o => o.AsReadOnly());
 164
 0165            return converted;
 166        }
 167
 168        #endregion // Internal/private methods
 169    }
 170}