1+ Get-Module Outsystems.SetupTools | Remove-Module - Force
2+ Import-Module $PSScriptRoot \..\..\src\Outsystems.SetupTools - Force - ArgumentList $false , ' ' , ' ' , $false
3+
4+ InModuleScope - ModuleName OutSystems.SetupTools {
5+ Describe ' Get-OSRepoAvailableVersions Tests' {
6+
7+ $AzRepoFiles = (
8+ ' DevelopmentEnvironment-11.14.3.56735.exe' ,
9+ ' DevelopmentEnvironment-11.14.14.59923.exe' ,
10+ ' DevelopmentEnvironment-11.14.16.60354.exe' ,
11+ ' IntegrationStudio-11.14.22.112.exe' ,
12+ ' IntegrationStudio-11.14.23.119.exe' ,
13+ ' IntegrationStudio-11.14.24.121.exe' ,
14+ ' LifeTimeWithPlatformServer-11.10.3.1469.0.exe' ,
15+ ' LifeTimeWithPlatformServer-11.14.0.2131..exe' ,
16+ ' LifeTimeWithPlatformServer-11.26.2.3750.exe' ,
17+ ' PlatformServer-11.33.1.44835.exe' ,
18+ ' PlatformServer-11.34.0.44828.exe' ,
19+ ' PlatformServer-11.34.1.45035.exe' ,
20+ ' SQLServer2017-SSEI-Expr.exe' ,
21+ ' SSMS-Setup-ENU.exe' ,
22+ ' ServiceStudio-11.55.16.64072.exe' ,
23+ ' ServiceStudio-11.55.17.64089.exe' ,
24+ ' ServiceStudio-11.55.18.64106.exe' ,
25+ ' imagebuilder.exe' ,
26+ ' license.lic' ,
27+ ' license10.lic'
28+ )
29+
30+ # Global mocks
31+ Mock GetAzStorageFileList { return $AzRepoFiles }
32+
33+ Context ' When getting Platform Server versions' {
34+
35+ $result = Get-OSRepoAvailableVersions - Application ' PlatformServer' - MajorVersion ' 11' - ErrorVariable err - ErrorAction SilentlyContinue
36+
37+ It ' Should not have errors' { $err.Count | Should Be 0 }
38+ It ' Should return at least one version' { $result.Count | Should BeGreaterThan 0 }
39+ }
40+
41+ Context ' When getting Platform Server latest version' {
42+
43+ $result = Get-OSRepoAvailableVersions - Application ' PlatformServer' - MajorVersion ' 11' - Latest - ErrorVariable err - ErrorAction SilentlyContinue
44+
45+ It ' Should not have errors' { $err.Count | Should Be 0 }
46+ It ' Should return exactly one version' { $result.Count | Should Be 1 }
47+ }
48+
49+ Context ' When getting Development Environment versions' {
50+
51+ $result = Get-OSRepoAvailableVersions - Application ' DevelopmentEnvironment' - MajorVersion ' 11' - ErrorVariable err - ErrorAction SilentlyContinue
52+
53+ It ' Should not have errors' { $err.Count | Should Be 0 }
54+ It ' Should return at least one version' { $result.Count | Should BeGreaterThan 0 }
55+ }
56+
57+ Context ' When getting Development Environment latest version' {
58+
59+ $result = Get-OSRepoAvailableVersions - Application ' DevelopmentEnvironment' - MajorVersion ' 11' - Latest - ErrorVariable err - ErrorAction SilentlyContinue
60+
61+ It ' Should not have errors' { $err.Count | Should Be 0 }
62+ It ' Should return exactly one version' { $result.Count | Should Be 1 }
63+ }
64+
65+ Context ' When getting Lifetime versions' {
66+
67+ $result = Get-OSRepoAvailableVersions - Application ' Lifetime' - MajorVersion ' 11' - ErrorVariable err - ErrorAction SilentlyContinue
68+
69+ It ' Should not have errors' { $err.Count | Should Be 0 }
70+ It ' Should return at least one version' { $result.Count | Should BeGreaterThan 0 }
71+ }
72+
73+ Context ' When getting Lifetime latest version' {
74+
75+ $result = Get-OSRepoAvailableVersions - Application ' Lifetime' - MajorVersion ' 11' - Latest - ErrorVariable err - ErrorAction SilentlyContinue
76+
77+ It ' Should not have errors' { $err.Count | Should Be 0 }
78+ It ' Should return exactly one version' { $result.Count | Should Be 1 }
79+ }
80+
81+ Context ' When getting Integration Studio versions' {
82+
83+ $result = Get-OSRepoAvailableVersions - Application ' IntegrationStudio' - MajorVersion ' 11' - ErrorVariable err - ErrorAction SilentlyContinue
84+
85+ It ' Should not have errors' { $err.Count | Should Be 0 }
86+ It ' Should return at least one version' { $result.Count | Should BeGreaterThan 0 }
87+ }
88+
89+ Context ' When getting Integration Studio latest version' {
90+
91+ $result = Get-OSRepoAvailableVersions - Application ' IntegrationStudio' - MajorVersion ' 11' - Latest - ErrorVariable err - ErrorAction SilentlyContinue
92+
93+ It ' Should not have errors' { $err.Count | Should Be 0 }
94+ It ' Should return exactly one version' { $result.Count | Should Be 1 }
95+ }
96+
97+ Context ' When getting Service Studio versions' {
98+
99+ $result = Get-OSRepoAvailableVersions - Application ' ServiceStudio' - MajorVersion ' 11' - ErrorVariable err - ErrorAction SilentlyContinue
100+
101+ It ' Should not have errors' { $err.Count | Should Be 0 }
102+ It ' Should return at least one version' { $result.Count | Should BeGreaterThan 0 }
103+ }
104+
105+ Context ' When getting Service Studio latest version' {
106+
107+ $result = Get-OSRepoAvailableVersions - Application ' ServiceStudio' - MajorVersion ' 11' - Latest - ErrorVariable err - ErrorAction SilentlyContinue
108+
109+ It ' Should not have errors' { $err.Count | Should Be 0 }
110+ It ' Should return exactly one version' { $result.Count | Should Be 1 }
111+ }
112+
113+ }
114+ }
0 commit comments