tracks/powershell/exercises/two-fer/TwoFer.tests.ps1 in trackler-2.2.1.144 vs tracks/powershell/exercises/two-fer/TwoFer.tests.ps1 in trackler-2.2.1.145
- old
+ new
@@ -3,34 +3,34 @@
$CommandName = "Get-TwoFer"
# Remove the function if its already found
If (Get-Command $CommandName -ErrorAction SilentlyContinue){
- Write-Verbose "Removing the existing $CommandName function as it exists"
- Remove-Item -Path "Function:\$CommandName"
+ Write-Verbose "Removing the existing $CommandName function as it exists"
+ Remove-Item -Path "Function:\$CommandName"
}
# Load the script file
If (Test-Path "$ExercisePath\$ScriptFile"){
- Write-Output ("Loading: {0}" -f "$ExercisePath\$ScriptFile")
- . ("$ExercisePath\$ScriptFile")
+ Write-Output ("Loading: {0}" -f "$ExercisePath\$ScriptFile")
+ . ("$ExercisePath\$ScriptFile")
}
Else {
- # Display an error and stop the tests
- Write-Error "The file $ScriptFile was not found. You need to create your answer in a file named $ScriptFile" -ErrorAction Stop
+ # Display an error and stop the tests
+ Write-Error "The file $ScriptFile was not found. You need to create your answer in a file named $ScriptFile" -ErrorAction Stop
}
Describe "Get-TwoFer" {
-
- It "Given <Name> expects <Expected>" -TestCases @(
- @{ Name = $null; Expected = "One for you, one for me" },
- @{ Name = ""; Expected = "One for you, one for me" },
- @{ Name = "Alice"; Expected = "One for Alice, one for me" }
- ) {
- Param(
- $Name, $Expected
- )
- Get-TwoFer -Name $Name | Should -Be $Expected
- }
+ It "Given <Name> expects <Expected>" -TestCases @(
+ @{ Name = $null; Expected = "One for you, one for me" },
+ @{ Name = ""; Expected = "One for you, one for me" },
+ @{ Name = "Alice"; Expected = "One for Alice, one for me" }
+ ) {
+ Param(
+ $Name, $Expected
+ )
+
+ Get-TwoFer -Name $Name | Should -Be $Expected
+ }
}
\ No newline at end of file