DSInternals/Src/DSInternals.PowerShell/Tests/ConvertFrom-UnicodePassword.Tests.ps1
2015-12-26 23:44:43 +01:00

18 lines
568 B
PowerShell

Describe "ConvertFrom-UnicodePassword" {
Context "When correct input is provided" {
$input = 'UABhACQAJAB3ADAAcgBkAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA=='
$expected = 'Pa$$w0rd'
$actual = ConvertFrom-UnicodePassword $input
It "should return the correct password" {
$actual | Should BeExactly $expected
}
}
Context "When the input is malformed" {
$input = 'abc'
It "should throw an exception" {
{ ConvertFrom-UnicodePassword $input } | Should Throw
}
}
}