Skip to content

Instantly share code, notes, and snippets.

@shaneis
Created December 27, 2017 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaneis/fd325b15efe66765e4259a48ee540795 to your computer and use it in GitHub Desktop.
Save shaneis/fd325b15efe66765e4259a48ee540795 to your computer and use it in GitHub Desktop.
Pester test for the first AOC
Describe -Name 'Get-AOCDay01Part01' {
It -name 'should return a result of [<ExpectedResult>] for the input [<InputObject>]' -TestCases @(
@{ InputObject = 1122; ExpectedResult = 3 },
@{ InputObject = 1111; ExpectedResult = 4 },
@{ InputObject = 1234; ExpectedResult = 0 },
@{ InputObject = 91212129; ExpectedResult = 9 }
) {
param($InputObject, $ExpectedResult)
$Result = Get-AOCDay01Part01 -InputObject $InputObject
$Result | Should -Be $ExpectedResult
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment