Functions/Get-StringWithWhitespaceReplaced.Tests.ps1
describe "BitTitan.Runbooks.Common/Get-StringWithWhitespaceReplaced" -Tag "module", "unit" { # Import the function to test . "$($PSScriptRoot)\Get-StringWithWhitespaceReplaced.ps1" it "replaces whitespace characters with spaces" { $output = Get-StringWithWhitespaceReplaced -String "string`rwith all possible and successive`nwhite`tspace`vcharacters" $output | Should Be "string with all possible and successive white space characters" } it "replaces the whitespace characters with an empty string" { # Prepare the function input $inputString = "string`rwith all possible and successive`nwhite`tspace`vcharacters" # Call the function $output = Get-StringWithWhitespaceReplaced -String $inputString -ReplacedBy "" # Verify the output $output | Should Be "stringwithallpossibleandsuccessivewhitespacecharacters" } } |