Functions/Get-StringValueWithoutBom.Tests.ps1
describe "BitTitan.Runbooks.Common/Get-StringValueWithoutBom" -Tag "module", "unit" { # Import the function to test . "$($PSScriptRoot)\Get-StringValueWithoutBom.ps1" it "returns the string value without the BOM when given a string with the BOM" { # Prepare the function input $inputString = "$([Char]65279)foobar" $inputString.length | Should be 7 # Call the function $output = Get-StringValueWithoutBom $inputString # Verify the output $output.length | Should Be 6 $output | Should Be "foobar" } it "returns the string value when given a string without the BOM" { # Prepare the function input $inputString = "foobar" $inputString.length | Should be 6 # Call the function $output = Get-StringValueWithoutBom $inputString # Verify the output $output | Should Be "foobar" } } |