Sha256: 6bdcf664047248b7851e43d0bf09e3a94d7c14d1d1872ded4dd009a0eeb8d795

Contents?: true

Size: 1.14 KB

Versions: 35

Compression:

Stored size: 1.14 KB

Contents

$ExercisePath = Split-Path -Parent $MyInvocation.MyCommand.Path
$ScriptFile = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")

$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"
}

# Load the script file
If (Test-Path "$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
}


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
    }
}

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.179 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.178 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.177 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.176 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.175 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.174 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.173 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.172 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.171 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.170 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.169 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.167 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.166 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.165 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.164 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.163 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.162 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.161 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1
trackler-2.2.1.160 tracks/powershell/exercises/two-fer/TwoFer.tests.ps1