< Summary

Class:Microsoft.Azure.Batch.CloudServiceConfiguration
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\CloudServiceConfiguration.cs
Covered lines:36
Uncovered lines:1
Coverable lines:37
Total lines:135
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_OSFamily()-100%100%
set_OSFamily(...)-100%100%
get_OSVersion()-100%100%
set_OSVersion(...)-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.CloudServiceConfiguration>.GetTransportObject()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\CloudServiceConfiguration.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    /// The configuration for compute nodes in a pool based on the Azure Cloud Services platform.
 22    /// </summary>
 23    public partial class CloudServiceConfiguration : ITransportObjectProvider<Models.CloudServiceConfiguration>, IProper
 24    {
 25        private class PropertyContainer : PropertyCollection
 26        {
 27            public readonly PropertyAccessor<string> OSFamilyProperty;
 28            public readonly PropertyAccessor<string> OSVersionProperty;
 29
 25130            public PropertyContainer() : base(BindingState.Unbound)
 31            {
 25132                this.OSFamilyProperty = this.CreatePropertyAccessor<string>(nameof(OSFamily), BindingAccess.Read | Bindi
 25133                this.OSVersionProperty = this.CreatePropertyAccessor<string>(nameof(OSVersion), BindingAccess.Read | Bin
 25134            }
 35
 58436            public PropertyContainer(Models.CloudServiceConfiguration protocolObject) : base(BindingState.Bound)
 37            {
 58438                this.OSFamilyProperty = this.CreatePropertyAccessor(
 58439                    protocolObject.OsFamily,
 58440                    nameof(OSFamily),
 58441                    BindingAccess.Read | BindingAccess.Write);
 58442                this.OSVersionProperty = this.CreatePropertyAccessor(
 58443                    protocolObject.OsVersion,
 58444                    nameof(OSVersion),
 58445                    BindingAccess.Read | BindingAccess.Write);
 58446            }
 47        }
 48
 49        private readonly PropertyContainer propertyContainer;
 50
 51        #region Constructors
 52
 53        /// <summary>
 54        /// Initializes a new instance of the <see cref="CloudServiceConfiguration"/> class.
 55        /// </summary>
 56        /// <param name='osFamily'>The Azure Guest OS family to be installed on the virtual machines in the pool.</param
 57        /// <param name='osVersion'>The Azure Guest OS version to be installed on the virtual machines in the pool. If n
 58        /// Batch service will default to "'*", which specifies the latest operating system version for the <see cref="O
 25159        public CloudServiceConfiguration(
 25160            string osFamily,
 25161            string osVersion = default(string))
 62        {
 25163            this.propertyContainer = new PropertyContainer();
 25164            this.OSFamily = osFamily;
 25165            this.OSVersion = osVersion;
 25166        }
 67
 58468        internal CloudServiceConfiguration(Models.CloudServiceConfiguration protocolObject)
 69        {
 58470            this.propertyContainer = new PropertyContainer(protocolObject);
 58471        }
 72
 73        #endregion Constructors
 74
 75        #region CloudServiceConfiguration
 76
 77        /// <summary>
 78        /// Gets or sets the Azure Guest OS family to be installed on the virtual machines in the pool.
 79        /// </summary>
 80        /// <remarks>
 81        /// For more information about Guest OS families, see https://azure.microsoft.com/documentation/articles/cloud-s
 82        /// </remarks>
 83        public string OSFamily
 84        {
 107985            get { return this.propertyContainer.OSFamilyProperty.Value; }
 73786            set { this.propertyContainer.OSFamilyProperty.Value = value; }
 87        }
 88
 89        /// <summary>
 90        /// Gets or sets the Azure Guest OS version to be installed on the virtual machines in the pool. If no value is 
 91        /// the Batch service will default to "'*", which specifies the latest operating system version for the <see cre
 92        /// </summary>
 93        public string OSVersion
 94        {
 107795            get { return this.propertyContainer.OSVersionProperty.Value; }
 74396            set { this.propertyContainer.OSVersionProperty.Value = value; }
 97        }
 98
 99        #endregion // CloudServiceConfiguration
 100
 101        #region IPropertyMetadata
 102
 103        bool IModifiable.HasBeenModified
 104        {
 2105            get { return this.propertyContainer.HasBeenModified; }
 106        }
 107
 108        bool IReadOnly.IsReadOnly
 109        {
 0110            get { return this.propertyContainer.IsReadOnly; }
 982111            set { this.propertyContainer.IsReadOnly = value; }
 112        }
 113
 114        #endregion //IPropertyMetadata
 115
 116        #region Internal/private methods
 117        /// <summary>
 118        /// Return a protocol object of the requested type.
 119        /// </summary>
 120        /// <returns>The protocol object of the requested type.</returns>
 121        Models.CloudServiceConfiguration ITransportObjectProvider<Models.CloudServiceConfiguration>.GetTransportObject()
 122        {
 249123            Models.CloudServiceConfiguration result = new Models.CloudServiceConfiguration()
 249124            {
 249125                OsFamily = this.OSFamily,
 249126                OsVersion = this.OSVersion,
 249127            };
 128
 249129            return result;
 130        }
 131
 132
 133        #endregion // Internal/private methods
 134    }
 135}