@@ -45,10 +45,10 @@ public void BuildWithUndefinedNativeSymbol(bool allowUndefined)
45
45
File . WriteAllText ( Path . Combine ( _projectDir ! , "Program.cs" ) , code ) ;
46
46
File . Copy ( Path . Combine ( BuildEnvironment . TestAssetsPath , "native-libs" , "undefined-symbol.c" ) , Path . Combine ( _projectDir ! , "undefined_xyz.c" ) ) ;
47
47
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" ) ;
52
52
53
53
if ( allowUndefined )
54
54
{
@@ -83,17 +83,17 @@ public void ProjectWithDllImportsRequiringMarshalIlGen_ArrayTypeParameter(string
83
83
Path . Combine ( _projectDir ! , "Program.cs" ) ,
84
84
overwrite : true ) ;
85
85
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") ;
90
90
91
91
Assert . True ( result . ExitCode == 0 , "Expected build to succeed" ) ;
92
92
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 ( ) ;
97
97
Assert . Contains ( "Hello, Console!" , res . Output ) ;
98
98
Assert . Contains ( "Hello, World! Greetings from node version" , res . Output ) ;
99
99
}
0 commit comments