-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates New-TeamViewerUser.Tests.ps1
- Loading branch information
1 parent
4eff85c
commit 4877941
Showing
1 changed file
with
6 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,9 @@ BeforeAll { | |
# We do this only for testing | ||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] | ||
param() | ||
Process { $_ | ConvertTo-SecureString -AsPlainText -Force } | ||
Process { | ||
$_ | ConvertTo-SecureString -AsPlainText -Force | ||
} | ||
} | ||
} | ||
|
||
|
@@ -25,9 +27,7 @@ Describe 'New-TeamViewerUser' { | |
New-TeamViewerUser -ApiToken $testApiToken -Name 'Unit Test User' -Email '[email protected]' -WithoutPassword | ||
|
||
Assert-MockCalled Invoke-TeamViewerRestMethod -Times 1 -Scope It -ParameterFilter { | ||
$ApiToken -eq $testApiToken -And ` | ||
$Uri -eq '//unit.test/users' -And ` | ||
$Method -eq 'Post' } | ||
$ApiToken -eq $testApiToken -And $Uri -eq '//unit.test/users' -And $Method -eq 'Post' } | ||
} | ||
|
||
It 'Should include the given name and email in the request' { | ||
|
@@ -64,6 +64,7 @@ Describe 'New-TeamViewerUser' { | |
|
||
It 'Should allow to specify a password for the new user' { | ||
$testPassword = 'Test1234' | ConvertTo-TestPassword | ||
|
||
New-TeamViewerUser -ApiToken $testApiToken -Name 'Unit Test User' -Email '[email protected]' -Password $testPassword | ||
|
||
$mockArgs.Body | Should -Not -BeNullOrEmpty | ||
|
@@ -73,6 +74,7 @@ Describe 'New-TeamViewerUser' { | |
|
||
It 'Should allow to create a SSO-enabled user' { | ||
$testSsoCustomerId = 'my-sso-customer-id' | ConvertTo-TestPassword | ||
|
||
New-TeamViewerUser -ApiToken $testApiToken -Name 'Unit Test User' -Email '[email protected]' -WithoutPassword -SsoCustomerIdentifier $testSsoCustomerId | ||
|
||
$mockArgs.Body | Should -Not -BeNullOrEmpty | ||
|