< Summary

Class:Azure.Identity.StringExtensions
Assembly:Azure.Identity
File(s):C:\Git\azure-sdk-for-net\sdk\identity\Azure.Identity\src\StringExtensions.cs
Covered lines:5
Uncovered lines:1
Coverable lines:6
Total lines:23
Line coverage:83.3% (5 of 6)
Covered branches:3
Total branches:4
Branch coverage:75% (3 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSecureString(...)-83.33%75%

File(s)

C:\Git\azure-sdk-for-net\sdk\identity\Azure.Identity\src\StringExtensions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Security;
 5
 6namespace Azure.Identity
 7{
 8    internal static class StringExtensions
 9    {
 10        public static SecureString ToSecureString(this string plainString)
 11        {
 1612            if (plainString == null)
 013                return null;
 14
 1615            SecureString secureString = new SecureString();
 53616            foreach (char c in plainString.ToCharArray())
 17            {
 25218                secureString.AppendChar(c);
 19            }
 1620            return secureString;
 21        }
 22    }
 23}

Methods/Properties

ToSecureString(...)