Skip to content

Commit 5163b83

Browse files
committed
Fix run parser test to correctly copy the test source
1 parent 0cdba96 commit 5163b83

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

test/dotnet.Tests/CommandTests/Run/RunParserTests.cs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,14 @@ public RunParserTests(ITestOutputHelper output)
1818
public void RunParserCanGetArgumentFromDoubleDash()
1919
{
2020
var tam = new TestAssetsManager(output);
21-
var oldWorkingDirectory = Directory.GetCurrentDirectory();
22-
var newWorkingDir = tam.CopyTestAsset("HelloWorld").Path;
21+
var testAsset = tam.CopyTestAsset("HelloWorld").WithSource();
22+
var newWorkingDir = testAsset.Path;
2323

24-
try
25-
{
26-
Directory.SetCurrentDirectory(newWorkingDir);
27-
var projectPath = Path.Combine(newWorkingDir, "HelloWorld.csproj");
24+
Directory.SetCurrentDirectory(newWorkingDir);
25+
var projectPath = Path.Combine(newWorkingDir, "HelloWorld.csproj");
2826

29-
var runCommand = RunCommand.FromArgs(new[] { "--project", projectPath, "--", "foo" });
30-
runCommand.Args.Single().Should().Be("foo");
31-
}
32-
finally
33-
{
34-
Directory.SetCurrentDirectory(oldWorkingDirectory);
35-
}
27+
var runCommand = RunCommand.FromArgs(new[] { "--project", projectPath, "--", "foo" });
28+
runCommand.Args.Single().Should().Be("foo");
3629
}
3730
}
3831
}

0 commit comments

Comments
 (0)