Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion powershell/public/services/exchange/Get-MtExo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
### - add them to the hashtable below
### - confirm the command's return type is in OutputType (e.g. (Get-AcceptedDomain).GetType().Name)
$commands = @{
"AcceptedDomain" = "Get-AcceptedDomain"
"AcceptedDomain" = "Get-AcceptedDomain -ResultSize 'Unlimited'"
"RemoteDomain" = "Get-RemoteDomain"
"TransportConfig" = "Get-TransportConfig"
"TransportRule" = "Get-TransportRule"
Expand Down
16 changes: 15 additions & 1 deletion powershell/tests/functions/Get-MtExo.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,17 @@
[PSCustomObject]@{ UserPrincipalName = 'vip@example.test'; IsVIP = $IsVIP.IsPresent; ResultSize = $ResultSize }
}
} | Import-Module -Global -Force
New-Module -Name tmpEXO_domain_mttest -ScriptBlock {
function Get-AcceptedDomain {
[CmdletBinding()]
param([string]$ResultSize)
[PSCustomObject]@{ Name = 'contoso.com'; ResultSize = $ResultSize }
}
} | Import-Module -Global -Force
}

AfterAll {
Remove-Module tmpEXO_restricted_mttest, tmpEXO_mttest, tmpEOP_mttest, tmpEXO_vip_mttest -Force -ErrorAction SilentlyContinue
Remove-Module tmpEXO_restricted_mttest, tmpEXO_mttest, tmpEOP_mttest, tmpEXO_vip_mttest, tmpEXO_domain_mttest -Force -ErrorAction SilentlyContinue
Clear-MtExoCache
}

Expand Down Expand Up @@ -74,4 +81,11 @@
$vipUsers[0].IsVIP | Should -BeTrue
$vipUsers[0].ResultSize | Should -Be 'Unlimited'
}

It 'Requests every accepted domain' {
$domains = @(Get-MtExo -Request AcceptedDomain)

$domains.Count | Should -Be 1
$domains[0].ResultSize | Should -Be 'Unlimited'
}
}
Loading