< Summary

Class:Microsoft.Azure.Batch.TaskInformation
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\TaskInformation.cs
Covered lines:21
Uncovered lines:11
Coverable lines:32
Total lines:138
Line coverage:65.6% (21 of 32)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_ExecutionInformation()-100%100%
get_JobId()-100%100%
get_SubtaskId()-100%100%
get_TaskId()-100%100%
get_TaskState()-100%100%
get_TaskUrl()-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%
ConvertFromProtocolCollection(...)-0%100%
ConvertFromProtocolCollectionAndFreeze(...)-0%100%
ConvertFromProtocolCollectionReadOnly(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\TaskInformation.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 compute node's task info class.
 22    /// </summary>
 23    public partial class TaskInformation : IPropertyMetadata
 24    {
 25        #region Constructors
 26
 218227        internal TaskInformation(Models.TaskInformation protocolObject)
 28        {
 323529            this.ExecutionInformation = UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ExecutionInfo, o => n
 218230            this.JobId = protocolObject.JobId;
 218231            this.SubtaskId = protocolObject.SubtaskId;
 218232            this.TaskId = protocolObject.TaskId;
 218233            this.TaskState = UtilitiesInternal.MapEnum<Models.TaskState, Common.TaskState>(protocolObject.TaskState);
 218234            this.TaskUrl = protocolObject.TaskUrl;
 218235        }
 36
 37        #endregion Constructors
 38
 39        #region TaskInformation
 40
 41        /// <summary>
 42        /// Gets the execution information for the task.
 43        /// </summary>
 218244        public TaskExecutionInformation ExecutionInformation { get; }
 45
 46        /// <summary>
 47        /// Gets the job id.
 48        /// </summary>
 218249        public string JobId { get; }
 50
 51        /// <summary>
 52        /// Gets the subtask id.
 53        /// </summary>
 218254        public int? SubtaskId { get; }
 55
 56        /// <summary>
 57        /// Gets the task id.
 58        /// </summary>
 218259        public string TaskId { get; }
 60
 61        /// <summary>
 62        /// Gets the task state.
 63        /// </summary>
 218264        public Common.TaskState TaskState { get; }
 65
 66        /// <summary>
 67        /// Gets the task URL.
 68        /// </summary>
 218269        public string TaskUrl { get; }
 70
 71        #endregion // TaskInformation
 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
 218287            }
 88        }
 89
 90        #endregion // IPropertyMetadata
 91
 92        #region Internal/private methods
 93
 94
 95        /// <summary>
 96        /// Converts a collection of protocol layer objects to object layer collection objects.
 97        /// </summary>
 98        internal static IList<TaskInformation> ConvertFromProtocolCollection(IEnumerable<Models.TaskInformation> protoCo
 99        {
 0100            ConcurrentChangeTrackedModifiableList<TaskInformation> converted = UtilitiesInternal.CollectionToThreadSafeC
 0101                items: protoCollection,
 0102                objectCreationFunc: o => new TaskInformation(o));
 103
 0104            return converted;
 105        }
 106
 107        /// <summary>
 108        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
 109        /// </summary>
 110        internal static IList<TaskInformation> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.TaskInformation
 111        {
 0112            ConcurrentChangeTrackedModifiableList<TaskInformation> converted = UtilitiesInternal.CollectionToThreadSafeC
 0113                items: protoCollection,
 0114                objectCreationFunc: o => new TaskInformation(o).Freeze());
 115
 0116            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());
 117
 0118            return converted;
 119        }
 120
 121        /// <summary>
 122        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked 
 123        /// and returned as a readonly collection.
 124        /// </summary>
 125        internal static IReadOnlyList<TaskInformation> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.TaskInfo
 126        {
 1003127            IReadOnlyList<TaskInformation> converted =
 1003128                UtilitiesInternal.CreateObjectWithNullCheck(
 1003129                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
 1003130                        items: protoCollection,
 3678131                        objectCreationFunc: o => new TaskInformation(o).Freeze()), o => o.AsReadOnly());
 132
 1003133            return converted;
 134        }
 135
 136        #endregion // Internal/private methods
 137    }
 138}