We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b37219 commit 90bef69Copy full SHA for 90bef69
Tests/Get-Planet.Tests.ps1
@@ -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