@@ -45,10 +45,10 @@ public void BuildWithUndefinedNativeSymbol(bool allowUndefined)
4545 File . WriteAllText ( Path . Combine ( _projectDir ! , "Program.cs" ) , code ) ;
4646 File . Copy ( Path . Combine ( BuildEnvironment . TestAssetsPath , "native-libs" , "undefined-symbol.c" ) , Path . Combine ( _projectDir ! , "undefined_xyz.c" ) ) ;
4747
48- CommandResult result = new DotNetCommand ( s_buildEnv , _testOutput )
49- . WithWorkingDirectory ( _projectDir ! )
50- . WithEnvironmentVariable ( "NUGET_PACKAGES" , _nugetPackagesDir )
51- . ExecuteWithCapturedOutput ( "build" , "-c Release" ) ;
48+ using DotNetCommand cmd = new DotNetCommand ( s_buildEnv , _testOutput ) ;
49+ CommandResult result = cmd . WithWorkingDirectory ( _projectDir ! )
50+ . WithEnvironmentVariable ( "NUGET_PACKAGES" , _nugetPackagesDir )
51+ . ExecuteWithCapturedOutput ( "build" , "-c Release" ) ;
5252
5353 if ( allowUndefined )
5454 {
@@ -83,17 +83,17 @@ public void ProjectWithDllImportsRequiringMarshalIlGen_ArrayTypeParameter(string
8383 Path . Combine ( _projectDir ! , "Program.cs" ) ,
8484 overwrite : true ) ;
8585
86- CommandResult result = new DotNetCommand ( s_buildEnv , _testOutput )
87- . WithWorkingDirectory ( _projectDir ! )
88- . WithEnvironmentVariable ( "NUGET_PACKAGES" , _nugetPackagesDir )
89- . ExecuteWithCapturedOutput ( "build" , $ "-c { config } -bl") ;
86+ using DotNetCommand cmd = new DotNetCommand ( s_buildEnv , _testOutput ) ;
87+ CommandResult result = cmd . WithWorkingDirectory ( _projectDir ! )
88+ . WithEnvironmentVariable ( "NUGET_PACKAGES" , _nugetPackagesDir )
89+ . ExecuteWithCapturedOutput ( "build" , $ "-c { config } -bl") ;
9090
9191 Assert . True ( result . ExitCode == 0 , "Expected build to succeed" ) ;
9292
93- CommandResult res = new RunCommand ( s_buildEnv , _testOutput )
94- . WithWorkingDirectory ( _projectDir ! )
95- . ExecuteWithCapturedOutput ( $ "run --no-silent --no-build -c { config } ")
96- . EnsureSuccessful ( ) ;
93+ using RunCommand runCmd = new RunCommand ( s_buildEnv , _testOutput ) ;
94+ CommandResult res = runCmd . WithWorkingDirectory ( _projectDir ! )
95+ . ExecuteWithCapturedOutput ( $ "run --no-silent --no-build -c { config } ")
96+ . EnsureSuccessful ( ) ;
9797 Assert . Contains ( "Hello, Console!" , res . Output ) ;
9898 Assert . Contains ( "Hello, World! Greetings from node version" , res . Output ) ;
9999 }
0 commit comments