-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Be more explicit in Get-FinOpsToolkitVersion int test
- Loading branch information
Showing
3 changed files
with
38 additions
and
37 deletions.
There are no files selected for viewing
36 changes: 0 additions & 36 deletions
36
src/powershell/Tests/Integration/Get-FinOpsToolkitVersion.Tests.ps1
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
& "$PSScriptRoot/../Initialize-Tests.ps1" | ||
|
||
Describe 'Get-FinOpsToolkitVersion' { | ||
It 'Should return all known releases' { | ||
# Arrange | ||
$expected = @('0.1.1', '0.1', '0.0.1') | ||
|
||
# Act | ||
$result = Get-FinOpsToolkitVersion | ||
|
||
# Assert | ||
$result.Count | Should -Be $expected.Count | ||
$result | ForEach-Object { | ||
$ver = $_.Version | ||
$ver | Should -BeIn $expected -Because "version '$ver' should be added to the verification test" | ||
|
||
# All versions | ||
$_.Files.Name | Should -Contain "finops-hub-v$ver.zip" | ||
$_.Files.Name | Should -Contain "optimization-workbook-v$ver.zip" | ||
$_.Files.Name | Should -Contain "CostSummary.pbix" | ||
$_.Files.Name | Should -Contain "CommitmentDiscounts.pbix" | ||
|
||
# 0.1 and above | ||
if ([version]$_.Version -ge [version]'0.1') | ||
{ | ||
$_.Files.Name | Should -Contain "governance-workbook-v$ver.zip" | ||
$_.Files.Name | Should -Contain "FOCUS.pbix" | ||
$_.Files.Name | Should -Contain "PricingUnits.csv" | ||
$_.Files.Name | Should -Contain "Regions.csv" | ||
$_.Files.Name | Should -Contain "Services.csv" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters