< Summary

Class:Microsoft.Azure.Batch.ReadOnlyExtensions
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\IReadOnly.cs
Covered lines:2
Uncovered lines:0
Coverable lines:2
Total lines:21
Line coverage:100% (2 of 2)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
Freeze(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\IReadOnly.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
 4namespace Microsoft.Azure.Batch
 5{
 6    internal interface IReadOnly
 7    {
 8        bool IsReadOnly { get; set; }
 9    }
 10
 11    internal static class ReadOnlyExtensions
 12    {
 13        //TODO: It would be nice if semantically this didn't modify the initial object.  Sadly I am
 14        //TODO: not sure how we can easily accomplish that right now.
 15        internal static T Freeze<T>(this T o) where T : IReadOnly
 16        {
 9752817            o.IsReadOnly = true;
 9752818            return o;
 19        }
 20    }
 21}

Methods/Properties

Freeze(...)