1+ if (-not $PSScriptRoot ) {
2+ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path - Parent
3+ }
4+ Import-Module - Name Pester - Force
5+ Import-Module .\DLLInfo\DLLInfo.psm1 - Force
6+
7+ Describe ' Get-BuildConfiguration' {
8+ Context " Check test DLLs - x64" {
9+ It " Given valid -Assembly '<Assembly>', it returns '<Expected>'" - TestCases @ (
10+ @ { Assembly = " $PSScriptRoot \bin\Debug\AssemblyInfoTest.dll" ; Expected = ' Debug' }
11+ @ { Assembly = " $PSScriptRoot \bin\Release\AssemblyInfoTest.dll" ; Expected = ' Release' }
12+ @ { Assembly = " $PSScriptRoot \bin\x64\Debug\AssemblyInfoTest.dll" ; Expected = ' Debug' }
13+ @ { Assembly = " $PSScriptRoot \bin\x64\Release\AssemblyInfoTest.dll" ; Expected = ' Release' }
14+ ) {
15+ param ($Assembly , $Expected )
16+ Get-BuildConfiguration $Assembly | Should - Be $Expected
17+ }
18+ }
19+
20+ Context " Check test DLLs - x86" {
21+ It " Given valid -Assembly '<Assembly>', it returns '<Expected>'" - TestCases @ (
22+ @ { Assembly = " $PSScriptRoot \bin\x86\Debug\AssemblyInfoTest.dll" ; Expected = ' Debug' }
23+ @ { Assembly = " $PSScriptRoot \bin\x86\Release\AssemblyInfoTest.dll" ; Expected = ' Release' }
24+ ) {
25+ param ($Assembly , $Expected )
26+ $RunAs32Bit = {
27+ param ($Assembly )
28+ Import-Module .\DLLInfo\DLLInfo.psm1 - Force
29+ Get-BuildConfiguration $Assembly
30+ }
31+
32+ $Job = Start-Job $RunAs32Bit - RunAs32 - Arg $Assembly
33+ $Job | Wait-Job | Receive-Job | Should - Be $Expected
34+ }
35+ }
36+ }
0 commit comments