< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 37
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
PathNormalize(...)0%20%

File(s)

https://raw.githubusercontent.com/JeremyAnsel/JeremyAnsel.IO.Locator/16c8f4344390c6376cd2208cc1ae63a39862df37/JeremyAnsel.IO.Locator/JeremyAnsel.IO.DiscLocator/Utilities.cs

#LineLine coverage
 1// <copyright file="Utilities.cs" company="Jérémy Ansel">
 2// Copyright (c) 2015, 2019 Jérémy Ansel
 3// </copyright>
 4// <license>
 5// Licensed under the MIT license. See LICENSE.txt
 6// </license>
 7
 8namespace JeremyAnsel.IO.DiscLocator
 9{
 10    using System.Globalization;
 11    using System.IO;
 12
 13    /// <summary>
 14    /// Utility methods.
 15    /// </summary>
 16    internal static class Utilities
 17    {
 18        /// <summary>
 19        /// Normalizes a path.
 20        /// </summary>
 21        /// <param name="path">The path.</param>
 22        /// <returns>A normalized path.</returns>
 23        public static string PathNormalize(string path)
 24        {
 025            if (string.IsNullOrEmpty(path))
 26            {
 027                return string.Empty;
 28            }
 29
 030            return path
 031                .Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)
 032                .TrimStart(Path.DirectorySeparatorChar)
 033                .Insert(0, Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture));
 34        }
 35    }
 36}
 37

Methods/Properties

PathNormalize(System.String)