< Summary

Class:Microsoft.Azure.Batch.Utilities
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Utilities.cs
Covered lines:8
Uncovered lines:2
Coverable lines:10
Total lines:69
Line coverage:80% (8 of 10)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_CustomBehaviors()-100%100%
CreateTaskStateMonitor()-100%100%
get_ParentBatchClient()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Utilities.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
 4using System;
 5using System.Collections.Generic;
 6using System.Linq;
 7using System.Text;
 8using System.Threading.Tasks;
 9
 10namespace Microsoft.Azure.Batch
 11{
 12    /// <summary>
 13    /// Tools and utilities for the Azure Batch Service.
 14    /// </summary>
 15    public class Utilities : IInheritedBehaviors
 16    {
 17#region constructors
 18
 019        private Utilities()
 20        {
 021        }
 22
 323        internal Utilities(BatchClient parentBatchClient, IEnumerable<BatchClientBehavior> baseBehaviors)
 24        {
 325            this.ParentBatchClient = parentBatchClient;
 26
 27            // inherit the base behaviors
 328            InheritUtil.InheritClientBehaviorsAndSetPublicProperty(this, baseBehaviors);
 329        }
 30
 31#endregion constructors
 32
 33#region IInheritedBehaviors
 34
 35        /// <summary>
 36        /// Gets or sets a list of behaviors that modify or customize requests to the Batch service
 37        /// made via this <see cref="Utilities"/>.
 38        /// </summary>
 39        /// <remarks>
 40        /// <para>These behaviors are inherited by child objects.</para>
 41        /// <para>Modifications are applied in the order of the collection. The last write wins.</para>
 42        /// </remarks>
 643        public IList<BatchClientBehavior> CustomBehaviors { get; set; }
 44
 45#endregion IInheritedBehaviors
 46
 47#region Utilities
 48
 49        /// <summary>
 50        /// Creates an TaskStateMonitor.
 51        /// </summary>
 52        /// <returns>A <see cref="TaskStateMonitor"/> instance.</returns>
 53        public TaskStateMonitor CreateTaskStateMonitor()
 54        {
 355            TaskStateMonitor tsm = new TaskStateMonitor(this, this.CustomBehaviors);
 56
 357            return tsm;
 58        }
 59
 60#endregion Utilities
 61
 62#region internal/private
 63
 664        internal BatchClient ParentBatchClient { get; set; }
 65
 66#endregion internal/private
 67
 68    }
 69}