@@ -12,16 +12,20 @@ namespace HostActivation.Tests
1212{
1313 internal static class InstallLocationCommandResultExtensions
1414 {
15- private static bool IsRunningInWoW64 ( ) => OperatingSystem . IsWindows ( ) && ! Environment . Is64BitProcess ;
15+ private static bool IsRunningInWoW64 ( string rid ) => OperatingSystem . IsWindows ( ) && Environment . Is64BitOperatingSystem && rid . Equals ( "win-x86" ) ;
1616
1717 public static AndConstraint < CommandResultAssertions > HaveUsedDotNetRootInstallLocation ( this CommandResultAssertions assertion , string installLocation )
1818 {
19- return assertion . HaveUsedDotNetRootInstallLocation ( null , installLocation ) ;
19+ return assertion . HaveUsedDotNetRootInstallLocation ( installLocation , null , null ) ;
2020 }
2121
22- public static AndConstraint < CommandResultAssertions > HaveUsedDotNetRootInstallLocation ( this CommandResultAssertions assertion , string arch , string installLocation )
22+ public static AndConstraint < CommandResultAssertions > HaveUsedDotNetRootInstallLocation ( this CommandResultAssertions assertion ,
23+ string installLocation ,
24+ string arch ,
25+ string rid )
2326 {
24- string expectedEnvironmentVariable = ! string . IsNullOrEmpty ( arch ) ? $ "DOTNET_ROOT_{ arch . ToUpper ( ) } " : IsRunningInWoW64 ( ) ? "DOTNET_ROOT(x86)" : "DOTNET_ROOT" ;
27+ string expectedEnvironmentVariable = ! string . IsNullOrEmpty ( arch ) ? $ "DOTNET_ROOT_{ arch . ToUpper ( ) } " :
28+ IsRunningInWoW64 ( rid ) ? "DOTNET_ROOT(x86)" : "DOTNET_ROOT" ;
2529
2630 return assertion . HaveStdErrContaining ( $ "Using environment variable { expectedEnvironmentVariable } =[{ installLocation } ] as runtime location.") ;
2731 }
@@ -41,7 +45,7 @@ public static AndConstraint<CommandResultAssertions> HaveFoundDefaultInstallLoca
4145 return assertion . HaveStdErrContaining ( $ "Found install location path '{ installLocation } '.") ;
4246 }
4347
44- public static AndConstraint < CommandResultAssertions > HaveFoundArchSpecificInstallLocationInConfigFile ( this CommandResultAssertions assertion , string arch , string installLocation )
48+ public static AndConstraint < CommandResultAssertions > HaveFoundArchSpecificInstallLocationInConfigFile ( this CommandResultAssertions assertion , string installLocation , string arch )
4549 {
4650 return assertion . HaveStdErrContaining ( $ "Found architecture-specific install location path: '{ installLocation } ' ('{ arch } ').") ;
4751 }
0 commit comments