diff --git a/Modules/TeamCity/TeamCity-Artifacts.Tests.ps1 b/Modules/TeamCity/TeamCity-Artifacts.Tests.ps1 index 13ef192..79511b8 100644 --- a/Modules/TeamCity/TeamCity-Artifacts.Tests.ps1 +++ b/Modules/TeamCity/TeamCity-Artifacts.Tests.ps1 @@ -32,6 +32,21 @@ Describe "New-TeamCityWebClientConnection" { $connection.Credentials.UserName.should.match("teamcitysharpuser") } + + When "given connection details with credentials and Basic mode, Authorization header should be populated" { + + $parameters = @{ + ConnectionDetails = @{ + ServerUrl = "teamcity.codebetter.com" + Credential = New-Object System.Management.Automation.PSCredential("teamcitysharpuser", (ConvertTo-SecureString "qwerty" -asplaintext -force)) + UseSsl = $false + UseBasic = $true + }} + + $connection = New-TeamCityWebClientConnection @parameters + + $connection.Headers['Authorization'].should.match("dGVhbWNpdHlzaGFycHVzZXI6cXdlcnR5") + } } Describe "New-TeamCityUrl" { diff --git a/Modules/TeamCity/TeamCity.psm1 b/Modules/TeamCity/TeamCity.psm1 index 97580e4..162a6b1 100644 Binary files a/Modules/TeamCity/TeamCity.psm1 and b/Modules/TeamCity/TeamCity.psm1 differ