-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write a simple test for base64 encoding
- Loading branch information
Thomas Glatzer
committed
Aug 3, 2020
1 parent
09d915e
commit 58760d0
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
InModuleScope ACME-PS { | ||
Context 'ConvertTo-Base64Url and ConvertFrom-Base64 url are roundtrippable' { | ||
$value = [byte[]]@(131,251,190,1); | ||
|
||
$base64Form = ConvertTo-UrlBase64 -InputBytes $value; | ||
It 'Converted the input successfully' { | ||
$base64Form | Should -Be "g_u-AQ"; | ||
} | ||
|
||
$roundtripped = ConvertFrom-UrlBase64 $base64Form; | ||
It 'Should match the orginial array' { | ||
$roundtripped | Should -Be $value; | ||
} | ||
} | ||
} |