Skip to content

Commit 765016a

Browse files
committed
Nit
1 parent 9141736 commit 765016a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Cli/dotnet/commands/dotnet-sln/remove/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Microsoft.Build.Construction;
66
using Microsoft.Build.Execution;
77
using Microsoft.DotNet.Cli;
8-
using Microsoft.DotNet.Cli.Sln.Internal;
98
using Microsoft.DotNet.Cli.Utils;
109
using Microsoft.DotNet.Tools.Common;
1110
using Microsoft.Extensions.EnvironmentAbstractions;

test/dotnet-sln.Tests/GivenDotnetSlnRemove.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using Microsoft.DotNet.Cli.Sln.Internal;
54
using Microsoft.DotNet.Tools;
65
using Microsoft.DotNet.Tools.Common;
76
using Microsoft.VisualStudio.SolutionPersistence;
@@ -286,8 +285,9 @@ public async Task WhenDuplicateReferencesArePresentItRemovesThemAll(string solut
286285
.Path;
287286

288287
var solutionPath = Path.Combine(projectDirectory, "App.sln");
289-
SlnFile slnFile = SlnFile.Read(solutionPath);
290-
slnFile.Projects.Count.Should().Be(3);
288+
ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(solutionPath);
289+
SolutionModel solution = await serializer.OpenAsync(solutionPath, CancellationToken.None);
290+
solution.SolutionProjects.Count.Should().Be(3);
291291

292292
var projectToRemove = Path.Combine("Lib", "Lib.csproj");
293293
var cmd = new DotnetCommand(Log)
@@ -299,8 +299,7 @@ public async Task WhenDuplicateReferencesArePresentItRemovesThemAll(string solut
299299
outputText += Environment.NewLine + outputText;
300300
cmd.StdOut.Should().BeVisuallyEquivalentTo(outputText);
301301

302-
ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(solutionPath);
303-
SolutionModel solution = await serializer.OpenAsync(solutionPath, CancellationToken.None);
302+
solution = await serializer.OpenAsync(solutionPath, CancellationToken.None);
304303
solution.SolutionProjects.Count.Should().Be(1);
305304
solution.SolutionProjects.Single().FilePath.Should().Be(Path.Combine("App", "App.csproj"));
306305
}

0 commit comments

Comments
 (0)