code/Tests/Get-UnicodeCharacter.tests.ps1
describe "Get-UnicodeCharacter"{ $testcases = @( @{ Inputobject = "B" name = "capital B" return = @{ code = "0042" Name = "LATIN CAPITAL LETTER B" } } @{ Inputobject = "`t" name = "tab" return = @{ code = "0009" Name = "<control>" UpperCase = "CHARACTER TABULATION" } } @{ Inputobject = "0x1f" name = "Info character - byte reference" return = @{ code = "001F" Name = "<control>" UpperCase = "INFORMATION SEPARATOR ONE" } } @{ Inputobject = 31 name = "Info character - byte int" return = @{ code = "001F" Name = "<control>" UpperCase = "INFORMATION SEPARATOR ONE" } } ) it "can get the correct data for '<name>' (<Inputobject>)" -TestCases $testcases{ param( $Inputobject, $name, $return ) $data = Get-UnicodeCharacter $Inputobject $return.keys|%{ $data.$_ |should -be $return.$_ } } } |