@@ -61,6 +61,37 @@ Describe 'Test-JitOptimized' {
6161 Test-JitOptimized $Assembly
6262 }
6363
64+ $Job = Start-Job $RunAs32Bit - RunAs32 - Arg $Assembly
65+ $Job | Wait-Job | Receive-Job | Should - Be $Expected
66+ }
67+ }
68+ }
69+
70+ Describe ' Get-TargetCPU' {
71+ Context " Check test DLLs - x64" {
72+ It " Given valid -Assembly '<Assembly>', it returns <Expected>" - TestCases @ (
73+ @ { Assembly = " $PSScriptRoot \bin\Debug\AssemblyInfoTest.dll" ; Expected = ' AnyCPU' }
74+ @ { Assembly = " $PSScriptRoot \bin\Release\AssemblyInfoTest.dll" ; Expected = ' AnyCPU' }
75+ @ { Assembly = " $PSScriptRoot \bin\x64\Debug\AssemblyInfoTest.dll" ; Expected = ' AMD64' }
76+ @ { Assembly = " $PSScriptRoot \bin\x64\Release\AssemblyInfoTest.dll" ; Expected = ' AMD64' }
77+ ) {
78+ param ($Assembly , $Expected )
79+ Get-TargetCPU $Assembly | Should - Be $Expected
80+ }
81+ }
82+
83+ Context " Check test DLLs - x86" {
84+ It " Given valid -Assembly '<Assembly>', it returns <Expected>" - TestCases @ (
85+ @ { Assembly = " $PSScriptRoot \bin\x86\Debug\AssemblyInfoTest.dll" ; Expected = ' Intel32' }
86+ @ { Assembly = " $PSScriptRoot \bin\x86\Release\AssemblyInfoTest.dll" ; Expected = ' Intel32' }
87+ ) {
88+ param ($Assembly , $Expected )
89+ $RunAs32Bit = {
90+ param ($Assembly )
91+ Import-Module .\DLLInfo\DLLInfo.psm1 - Force
92+ Get-TargetCPU $Assembly
93+ }
94+
6495 $Job = Start-Job $RunAs32Bit - RunAs32 - Arg $Assembly
6596 $Job | Wait-Job | Receive-Job | Should - Be $Expected
6697 }
0 commit comments