Tests/Private/Invoke-NetUse.Tests.ps1
|
BeforeAll { . "$PSScriptRoot/../../Private/Invoke-NetUse.ps1" } Describe 'Invoke-NetUse' { Context 'When called with arguments' { It 'Invokes net use with the given arguments' { # We can't mock the external 'net' command, but we can verify the function exists # and has the expected parameters $cmd = Get-Command Invoke-NetUse $cmd | Should -Not -BeNullOrEmpty } It 'Has an Arguments parameter that allows empty collections' { $param = (Get-Command Invoke-NetUse).Parameters['Arguments'] $param | Should -Not -BeNullOrEmpty $param.Attributes | Where-Object { $_ -is [System.Management.Automation.AllowEmptyCollectionAttribute] } | Should -Not -BeNullOrEmpty } It 'Returns string output type' { $cmd = Get-Command Invoke-NetUse $outputType = $cmd.OutputType $outputType.Type | Should -Contain ([string[]]) } } } |