From 9f9f687ab7eda60e96597a259fa7d269ee0164ca Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Tue, 5 Nov 2024 14:08:50 -0800 Subject: [PATCH] Replace strings with chars --- src/Cli/dotnet/commands/dotnet-sln/list/Program.cs | 2 +- test/dotnet-sln.Tests/GivenDotnetSlnList.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cli/dotnet/commands/dotnet-sln/list/Program.cs b/src/Cli/dotnet/commands/dotnet-sln/list/Program.cs index db4a3825ff72..9dfb1f5f6f71 100644 --- a/src/Cli/dotnet/commands/dotnet-sln/list/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-sln/list/Program.cs @@ -47,7 +47,7 @@ private async Task ListAllProjectsAsync(string solutionFileFullPath, Cancellatio { paths = solution.SolutionFolders // VS-SolutionPersistence does not return a path object, so there might be issues with forward/backward slashes on different platforms - .Select(folder => Path.GetDirectoryName(folder.Path.TrimStart("/"))) + .Select(folder => Path.GetDirectoryName(folder.Path.TrimStart('/'))) .ToArray(); } else diff --git a/test/dotnet-sln.Tests/GivenDotnetSlnList.cs b/test/dotnet-sln.Tests/GivenDotnetSlnList.cs index f8144602ad25..f9487fc3155a 100644 --- a/test/dotnet-sln.Tests/GivenDotnetSlnList.cs +++ b/test/dotnet-sln.Tests/GivenDotnetSlnList.cs @@ -101,7 +101,7 @@ public void WhenInvalidSolutionIsPassedItPrintsErrorAndUsage(string solutionComm .Execute(solutionCommand, "InvalidSolution.sln", "list"); cmd.Should().Fail(); cmd.StdErr.Should().Contain( - string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, Path.Combine(projectDirectory, "InvalidSolution.sln"), "").TrimEnd(".")); + string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, Path.Combine(projectDirectory, "InvalidSolution.sln"), "").TrimEnd('.')); cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(""); } @@ -121,7 +121,7 @@ public void WhenInvalidSolutionIsFoundListPrintsErrorAndUsage(string solutionCom .Execute(solutionCommand, "list"); cmd.Should().Fail(); cmd.StdErr.Should().Contain( - string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, solutionFullPath, "").TrimEnd(".")); + string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, solutionFullPath, "").TrimEnd('.')); cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(""); }