@@ -12,16 +12,20 @@ namespace HostActivation.Tests
12
12
{
13
13
internal static class InstallLocationCommandResultExtensions
14
14
{
15
- private static bool IsRunningInWoW64 ( ) => OperatingSystem . IsWindows ( ) && ! Environment . Is64BitProcess ;
15
+ private static bool IsRunningInWoW64 ( string rid ) => OperatingSystem . IsWindows ( ) && Environment . Is64BitOperatingSystem && rid . Equals ( "win-x86" ) ;
16
16
17
17
public static AndConstraint < CommandResultAssertions > HaveUsedDotNetRootInstallLocation ( this CommandResultAssertions assertion , string installLocation )
18
18
{
19
- return assertion . HaveUsedDotNetRootInstallLocation ( null , installLocation ) ;
19
+ return assertion . HaveUsedDotNetRootInstallLocation ( installLocation , null , null ) ;
20
20
}
21
21
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 )
23
26
{
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" ;
25
29
26
30
return assertion . HaveStdErrContaining ( $ "Using environment variable { expectedEnvironmentVariable } =[{ installLocation } ] as runtime location.") ;
27
31
}
@@ -41,7 +45,7 @@ public static AndConstraint<CommandResultAssertions> HaveFoundDefaultInstallLoca
41
45
return assertion . HaveStdErrContaining ( $ "Found install location path '{ installLocation } '.") ;
42
46
}
43
47
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 )
45
49
{
46
50
return assertion . HaveStdErrContaining ( $ "Found architecture-specific install location path: '{ installLocation } ' ('{ arch } ').") ;
47
51
}
0 commit comments