< Summary

Class:Microsoft.Azure.Batch.ApplicationPackageReference
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ApplicationPackageReference.cs
Covered lines:41
Uncovered lines:7
Coverable lines:48
Total lines:168
Line coverage:85.4% (41 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_ApplicationId()-100%100%
set_ApplicationId(...)-100%100%
get_Version()-100%100%
set_Version(...)-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.ApplicationPackageReference>.GetTransportObject()-100%100%
ConvertFromProtocolCollection(...)-100%100%
ConvertFromProtocolCollectionAndFreeze(...)-100%100%
ConvertFromProtocolCollectionReadOnly(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ApplicationPackageReference.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 reference to an application package to be deployed to compute nodes.
 22    /// </summary>
 23    public partial class ApplicationPackageReference : ITransportObjectProvider<Models.ApplicationPackageReference>, IPr
 24    {
 25        private class PropertyContainer : PropertyCollection
 26        {
 27            public readonly PropertyAccessor<string> ApplicationIdProperty;
 28            public readonly PropertyAccessor<string> VersionProperty;
 29
 149130            public PropertyContainer() : base(BindingState.Unbound)
 31            {
 149132                this.ApplicationIdProperty = this.CreatePropertyAccessor<string>(nameof(ApplicationId), BindingAccess.Re
 149133                this.VersionProperty = this.CreatePropertyAccessor<string>(nameof(Version), BindingAccess.Read | Binding
 149134            }
 35
 653836            public PropertyContainer(Models.ApplicationPackageReference protocolObject) : base(BindingState.Bound)
 37            {
 653838                this.ApplicationIdProperty = this.CreatePropertyAccessor(
 653839                    protocolObject.ApplicationId,
 653840                    nameof(ApplicationId),
 653841                    BindingAccess.Read);
 653842                this.VersionProperty = this.CreatePropertyAccessor(
 653843                    protocolObject.Version,
 653844                    nameof(Version),
 653845                    BindingAccess.Read);
 653846            }
 47        }
 48
 49        private readonly PropertyContainer propertyContainer;
 50
 51        #region Constructors
 52
 53        /// <summary>
 54        /// Initializes a new instance of the <see cref="ApplicationPackageReference"/> class.
 55        /// </summary>
 149156        public ApplicationPackageReference()
 57        {
 149158            this.propertyContainer = new PropertyContainer();
 149159        }
 60
 653861        internal ApplicationPackageReference(Models.ApplicationPackageReference protocolObject)
 62        {
 653863            this.propertyContainer = new PropertyContainer(protocolObject);
 653864        }
 65
 66        #endregion Constructors
 67
 68        #region ApplicationPackageReference
 69
 70        /// <summary>
 71        /// Gets or sets the id of the application to be deployed on compute nodes.
 72        /// </summary>
 73        public string ApplicationId
 74        {
 951375            get { return this.propertyContainer.ApplicationIdProperty.Value; }
 150276            set { this.propertyContainer.ApplicationIdProperty.Value = value; }
 77        }
 78
 79        /// <summary>
 80        /// Gets or sets the version of the application to be deployed on compute nodes.
 81        /// </summary>
 82        /// <remarks>
 83        /// If not specified, the default version of the application, as defined in the application settings, is deploye
 84        /// If no default version is defined in the application settings, you must specify a version in the <see cref="A
 85        /// </remarks>
 86        public string Version
 87        {
 951388            get { return this.propertyContainer.VersionProperty.Value; }
 157889            set { this.propertyContainer.VersionProperty.Value = value; }
 90        }
 91
 92        #endregion // ApplicationPackageReference
 93
 94        #region IPropertyMetadata
 95
 96        bool IModifiable.HasBeenModified
 97        {
 298            get { return this.propertyContainer.HasBeenModified; }
 99        }
 100
 101        bool IReadOnly.IsReadOnly
 102        {
 0103            get { return this.propertyContainer.IsReadOnly; }
 27026104            set { this.propertyContainer.IsReadOnly = value; }
 105        }
 106
 107        #endregion //IPropertyMetadata
 108
 109        #region Internal/private methods
 110        /// <summary>
 111        /// Return a protocol object of the requested type.
 112        /// </summary>
 113        /// <returns>The protocol object of the requested type.</returns>
 114        Models.ApplicationPackageReference ITransportObjectProvider<Models.ApplicationPackageReference>.GetTransportObje
 115        {
 1489116            Models.ApplicationPackageReference result = new Models.ApplicationPackageReference()
 1489117            {
 1489118                ApplicationId = this.ApplicationId,
 1489119                Version = this.Version,
 1489120            };
 121
 1489122            return result;
 123        }
 124
 125        /// <summary>
 126        /// Converts a collection of protocol layer objects to object layer collection objects.
 127        /// </summary>
 128        internal static IList<ApplicationPackageReference> ConvertFromProtocolCollection(IEnumerable<Models.ApplicationP
 129        {
 1938130            ConcurrentChangeTrackedModifiableList<ApplicationPackageReference> converted = UtilitiesInternal.CollectionT
 1938131                items: protoCollection,
 6234132                objectCreationFunc: o => new ApplicationPackageReference(o));
 133
 1938134            return converted;
 135        }
 136
 137        /// <summary>
 138        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
 139        /// </summary>
 140        internal static IList<ApplicationPackageReference> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.App
 141        {
 1021142            ConcurrentChangeTrackedModifiableList<ApplicationPackageReference> converted = UtilitiesInternal.CollectionT
 1021143                items: protoCollection,
 3263144                objectCreationFunc: o => new ApplicationPackageReference(o).Freeze());
 145
 1520146            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());
 147
 1021148            return converted;
 149        }
 150
 151        /// <summary>
 152        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked 
 153        /// and returned as a readonly collection.
 154        /// </summary>
 155        internal static IReadOnlyList<ApplicationPackageReference> ConvertFromProtocolCollectionReadOnly(IEnumerable<Mod
 156        {
 0157            IReadOnlyList<ApplicationPackageReference> converted =
 0158                UtilitiesInternal.CreateObjectWithNullCheck(
 0159                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 0160                        items: protoCollection,
 0161                        objectCreationFunc: o => new ApplicationPackageReference(o).Freeze()), o => o.AsReadOnly());
 162
 0163            return converted;
 164        }
 165
 166        #endregion // Internal/private methods
 167    }
 168}