Skip to content

Commit

Permalink
Nit
Browse files Browse the repository at this point in the history
  • Loading branch information
edvilme committed Dec 11, 2024
1 parent 5d8fd94 commit d4f1128
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/Cli/dotnet/commands/dotnet-sln/remove/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 4 additions & 5 deletions test/dotnet-sln.Tests/GivenDotnetSlnRemove.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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"));
}
Expand Down

0 comments on commit d4f1128

Please sign in to comment.