< Summary

Class:Microsoft.Azure.Batch.ContainerRegistry
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ContainerRegistry.cs
Covered lines:29
Uncovered lines:12
Coverable lines:41
Total lines:153
Line coverage:70.7% (29 of 41)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor(...)-100%100%
get_Password()-100%100%
get_RegistryServer()-100%100%
get_UserName()-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.ContainerRegistry>.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\ContainerRegistry.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 private container registry.
 22    /// </summary>
 23    public partial class ContainerRegistry : ITransportObjectProvider<Models.ContainerRegistry>, IPropertyMetadata
 24    {
 25        #region Constructors
 26        /// <summary>
 27        /// Initializes a new instance of the <see cref="ContainerRegistry"/> class.
 28        /// </summary>
 29        /// <param name='userName'>The user name to log into the registry server.</param>
 30        /// <param name='registryServer'>The registry URL.</param>
 31        /// <param name='password'>The password to log into the registry server.</param>
 114332        public ContainerRegistry(
 114333            string userName,
 114334            string registryServer = default(string),
 114335            string password = default(string))
 36        {
 114337            this.UserName = userName;
 114338            this.RegistryServer = registryServer;
 114339            this.Password = password;
 114340        }
 41
 163442        internal ContainerRegistry(Models.ContainerRegistry protocolObject)
 43        {
 163444            this.Password = protocolObject.Password;
 163445            this.RegistryServer = protocolObject.RegistryServer;
 163446            this.UserName = protocolObject.UserName;
 163447        }
 48
 49        #endregion Constructors
 50
 51        #region ContainerRegistry
 52
 53        /// <summary>
 54        /// Gets the password to log into the registry server.
 55        /// </summary>
 391556        public string Password { get; }
 57
 58        /// <summary>
 59        /// Gets the registry URL.
 60        /// </summary>
 61        /// <remarks>
 62        /// If omitted, the default is "docker.io".
 63        /// </remarks>
 391564        public string RegistryServer { get; }
 65
 66        /// <summary>
 67        /// Gets the user name to log into the registry server.
 68        /// </summary>
 391569        public string UserName { get; }
 70
 71        #endregion // ContainerRegistry
 72
 73        #region IPropertyMetadata
 74
 75        bool IModifiable.HasBeenModified
 76        {
 77            //This class is compile time readonly so it cannot have been modified
 078            get { return false; }
 79        }
 80
 81        bool IReadOnly.IsReadOnly
 82        {
 083            get { return true; }
 84            set
 85            {
 86                // This class is compile time readonly already
 369287            }
 88        }
 89
 90        #endregion // IPropertyMetadata
 91
 92        #region Internal/private methods
 93
 94        /// <summary>
 95        /// Return a protocol object of the requested type.
 96        /// </summary>
 97        /// <returns>The protocol object of the requested type.</returns>
 98        Models.ContainerRegistry ITransportObjectProvider<Models.ContainerRegistry>.GetTransportObject()
 99        {
 1140100            Models.ContainerRegistry result = new Models.ContainerRegistry()
 1140101            {
 1140102                Password = this.Password,
 1140103                RegistryServer = this.RegistryServer,
 1140104                UserName = this.UserName,
 1140105            };
 106
 1140107            return result;
 108        }
 109
 110        /// <summary>
 111        /// Converts a collection of protocol layer objects to object layer collection objects.
 112        /// </summary>
 113        internal static IList<ContainerRegistry> ConvertFromProtocolCollection(IEnumerable<Models.ContainerRegistry> pro
 114        {
 0115            ConcurrentChangeTrackedModifiableList<ContainerRegistry> converted = UtilitiesInternal.CollectionToThreadSaf
 0116                items: protoCollection,
 0117                objectCreationFunc: o => new ContainerRegistry(o));
 118
 0119            return converted;
 120        }
 121
 122        /// <summary>
 123        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
 124        /// </summary>
 125        internal static IList<ContainerRegistry> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.ContainerRegi
 126        {
 284127            ConcurrentChangeTrackedModifiableList<ContainerRegistry> converted = UtilitiesInternal.CollectionToThreadSaf
 284128                items: protoCollection,
 852129                objectCreationFunc: o => new ContainerRegistry(o).Freeze());
 130
 419131            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());
 132
 284133            return converted;
 134        }
 135
 136        /// <summary>
 137        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked 
 138        /// and returned as a readonly collection.
 139        /// </summary>
 140        internal static IReadOnlyList<ContainerRegistry> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.Contai
 141        {
 0142            IReadOnlyList<ContainerRegistry> converted =
 0143                UtilitiesInternal.CreateObjectWithNullCheck(
 0144                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 0145                        items: protoCollection,
 0146                        objectCreationFunc: o => new ContainerRegistry(o).Freeze()), o => o.AsReadOnly());
 147
 0148            return converted;
 149        }
 150
 151        #endregion // Internal/private methods
 152    }
 153}