Skip to content

Commit 90bef69

Browse files
committed
Refreshing
1 parent 0b37219 commit 90bef69

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Tests/Get-Planet.Tests.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
BeforeAll {
2+
function Get-Planet ([string]$Name = '*') {
3+
$planets = @(
4+
@{ Name = 'Mercury' }
5+
@{ Name = 'Venus' }
6+
@{ Name = 'Earth' }
7+
@{ Name = 'Mars' }
8+
@{ Name = 'Jupiter' }
9+
@{ Name = 'Saturn' }
10+
@{ Name = 'Uranus' }
11+
@{ Name = 'Neptune' }
12+
) | ForEach-Object { [PSCustomObject] $_ }
13+
14+
$planets | Where-Object { $_.Name -like $Name }
15+
}
16+
}
17+
18+
Describe 'Get-Planet' {
19+
It 'Given no parameters, it lists all 8 planets' {
20+
$allPlanets = Get-Planet
21+
$allPlanets.Count | Should -Be 8
22+
}
23+
}

0 commit comments

Comments
 (0)