< Summary

Class:Microsoft.Azure.Batch.JobConstraints
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\JobConstraints.cs
Covered lines:36
Uncovered lines:1
Coverable lines:37
Total lines:130
Line coverage:97.2% (36 of 37)
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_MaxTaskRetryCount()-100%100%
set_MaxTaskRetryCount(...)-100%100%
get_MaxWallClockTime()-100%100%
set_MaxWallClockTime(...)-100%100%
Microsoft.Azure.Batch.IModifiable.get_HasBeenModified()-100%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.JobConstraints>.GetTransportObject()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\JobConstraints.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    /// Specifies the execution constraints for a job.
 22    /// </summary>
 23    public partial class JobConstraints : ITransportObjectProvider<Models.JobConstraints>, IPropertyMetadata
 24    {
 25        private class PropertyContainer : PropertyCollection
 26        {
 27            public readonly PropertyAccessor<int?> MaxTaskRetryCountProperty;
 28            public readonly PropertyAccessor<TimeSpan?> MaxWallClockTimeProperty;
 29
 21830            public PropertyContainer() : base(BindingState.Unbound)
 31            {
 21832                this.MaxTaskRetryCountProperty = this.CreatePropertyAccessor<int?>(nameof(MaxTaskRetryCount), BindingAcc
 21833                this.MaxWallClockTimeProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(MaxWallClockTime), Binding
 21834            }
 35
 75036            public PropertyContainer(Models.JobConstraints protocolObject) : base(BindingState.Bound)
 37            {
 75038                this.MaxTaskRetryCountProperty = this.CreatePropertyAccessor(
 75039                    protocolObject.MaxTaskRetryCount,
 75040                    nameof(MaxTaskRetryCount),
 75041                    BindingAccess.Read | BindingAccess.Write);
 75042                this.MaxWallClockTimeProperty = this.CreatePropertyAccessor(
 75043                    protocolObject.MaxWallClockTime,
 75044                    nameof(MaxWallClockTime),
 75045                    BindingAccess.Read | BindingAccess.Write);
 75046            }
 47        }
 48
 49        private readonly PropertyContainer propertyContainer;
 50
 51        #region Constructors
 52
 53        /// <summary>
 54        /// Initializes a new instance of the <see cref="JobConstraints"/> class.
 55        /// </summary>
 56        /// <param name='maxWallClockTime'>The maximum elapsed time that the job may run, measured from the time the job
 57        /// <param name='maxTaskRetryCount'>The maximum number of times each task may be retried.</param>
 21858        public JobConstraints(
 21859            TimeSpan? maxWallClockTime = default(TimeSpan?),
 21860            int? maxTaskRetryCount = default(int?))
 61        {
 21862            this.propertyContainer = new PropertyContainer();
 21863            this.MaxWallClockTime = maxWallClockTime;
 21864            this.MaxTaskRetryCount = maxTaskRetryCount;
 21865        }
 66
 75067        internal JobConstraints(Models.JobConstraints protocolObject)
 68        {
 75069            this.propertyContainer = new PropertyContainer(protocolObject);
 75070        }
 71
 72        #endregion Constructors
 73
 74        #region JobConstraints
 75
 76        /// <summary>
 77        /// Gets or sets the maximum number of times each task may be retried.
 78        /// </summary>
 79        public int? MaxTaskRetryCount
 80        {
 118381            get { return this.propertyContainer.MaxTaskRetryCountProperty.Value; }
 63982            set { this.propertyContainer.MaxTaskRetryCountProperty.Value = value; }
 83        }
 84
 85        /// <summary>
 86        /// Gets or sets the maximum elapsed time that the job may run, measured from the time the job is created.
 87        /// </summary>
 88        public TimeSpan? MaxWallClockTime
 89        {
 118390            get { return this.propertyContainer.MaxWallClockTimeProperty.Value; }
 63791            set { this.propertyContainer.MaxWallClockTimeProperty.Value = value; }
 92        }
 93
 94        #endregion // JobConstraints
 95
 96        #region IPropertyMetadata
 97
 98        bool IModifiable.HasBeenModified
 99        {
 2100            get { return this.propertyContainer.HasBeenModified; }
 101        }
 102
 103        bool IReadOnly.IsReadOnly
 104        {
 0105            get { return this.propertyContainer.IsReadOnly; }
 6106            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.JobConstraints ITransportObjectProvider<Models.JobConstraints>.GetTransportObject()
 117        {
 217118            Models.JobConstraints result = new Models.JobConstraints()
 217119            {
 217120                MaxTaskRetryCount = this.MaxTaskRetryCount,
 217121                MaxWallClockTime = this.MaxWallClockTime,
 217122            };
 123
 217124            return result;
 125        }
 126
 127
 128        #endregion // Internal/private methods
 129    }
 130}