-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shivangi
authored and
Shivangi
committed
Sep 17, 2019
1 parent
f56ed9f
commit c36228a
Showing
5 changed files
with
32 additions
and
59 deletions.
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,28 @@ | ||
[CmdletBinding()] | ||
param() | ||
|
||
# Arrange. | ||
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 | ||
$targetAzurePs = "4.1.0" | ||
Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require | ||
Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath | ||
Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs | ||
Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments | ||
Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference | ||
Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError | ||
Register-Mock Get-VstsInput { $true } -- -Name pwsh | ||
Register-Mock Get-VstsInput { ([System.IO.Path]::GetTempPath()) } -- -Name workingDirectory | ||
Register-Mock Update-PSModulePathForHostedAgent | ||
Register-Mock Get-Module | ||
Register-Mock Initialize-AzModule | ||
Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } | ||
Register-Mock Remove-EndpointSecrets | ||
Register-Mock Disconnect-AzureAndClearContext | ||
Register-Mock Assert-VstsPath | ||
Register-Mock Invoke-VstsTool { } | ||
|
||
# Act. | ||
$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 | ||
|
||
Assert-WasCalled Invoke-VstsTool -Times 1 | ||
Assert-WasCalled Invoke-VstsTool -ArgumentsEvaluator {$args.count -eq 6 -and $args[3] -like '*pwsh.exe*'} |
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
41 changes: 0 additions & 41 deletions
41
Tasks/AzurePowerShellV4/Tests/RemovesFunctionsAndVariables.ps1
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
Tasks/AzurePowerShellV4/Tests/RemovesFunctionsAndVariables_TargetScript.ps1
This file was deleted.
Oops, something went wrong.