From d4f1128d418e0dc950d732cc6062f47dfaa98c46 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Tue, 10 Dec 2024 16:32:50 -0800 Subject: [PATCH] Nit --- src/Cli/dotnet/commands/dotnet-sln/remove/Program.cs | 1 - test/dotnet-sln.Tests/GivenDotnetSlnRemove.cs | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Cli/dotnet/commands/dotnet-sln/remove/Program.cs b/src/Cli/dotnet/commands/dotnet-sln/remove/Program.cs index a96295141c39..37886d28ab20 100644 --- a/src/Cli/dotnet/commands/dotnet-sln/remove/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-sln/remove/Program.cs @@ -5,7 +5,6 @@ using Microsoft.Build.Construction; using Microsoft.Build.Execution; using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Sln.Internal; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; using Microsoft.Extensions.EnvironmentAbstractions; diff --git a/test/dotnet-sln.Tests/GivenDotnetSlnRemove.cs b/test/dotnet-sln.Tests/GivenDotnetSlnRemove.cs index 66526edcf843..c59d5e6a9c39 100644 --- a/test/dotnet-sln.Tests/GivenDotnetSlnRemove.cs +++ b/test/dotnet-sln.Tests/GivenDotnetSlnRemove.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.DotNet.Cli.Sln.Internal; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Common; using Microsoft.VisualStudio.SolutionPersistence; @@ -286,8 +285,9 @@ public async Task WhenDuplicateReferencesArePresentItRemovesThemAll(string solut .Path; var solutionPath = Path.Combine(projectDirectory, "App.sln"); - SlnFile slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(3); + ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(solutionPath); + SolutionModel solution = await serializer.OpenAsync(solutionPath, CancellationToken.None); + solution.SolutionProjects.Count.Should().Be(3); var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand(Log) @@ -299,8 +299,7 @@ public async Task WhenDuplicateReferencesArePresentItRemovesThemAll(string solut outputText += Environment.NewLine + outputText; cmd.StdOut.Should().BeVisuallyEquivalentTo(outputText); - ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(solutionPath); - SolutionModel solution = await serializer.OpenAsync(solutionPath, CancellationToken.None); + solution = await serializer.OpenAsync(solutionPath, CancellationToken.None); solution.SolutionProjects.Count.Should().Be(1); solution.SolutionProjects.Single().FilePath.Should().Be(Path.Combine("App", "App.csproj")); }