Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Jul 7, 2019
1 parent 815c15f commit 19ec994
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Tests/Unit/xActiveDirectory.Common.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1254,9 +1254,13 @@ InModuleScope 'xActiveDirectory.Common' {
}

It 'Should throw an InvalidOperationException when object parent does not exist' {
Mock -CommandName Restore-ADObject -MockWith { throw (New-Object -TypeName Microsoft.ActiveDirectory.Management.ADException)}
Mock -CommandName Restore-ADObject -MockWith {
throw New-Object -TypeName Microsoft.ActiveDirectory.Management.ADException
}

{Restore-ADCommonObject -Identity $restoreIdentity -ObjectClass $restoreObjectClass} | Should -Throw -ExceptionType ([System.InvalidOperationException])
{
Restore-ADCommonObject -Identity $restoreIdentity -ObjectClass $restoreObjectClass
} | Should -Throw ($script:localizedData.RecycleBinRestoreFailed -f $restoreIdentity, $restoreObjectClass)
}
}

Expand Down

0 comments on commit 19ec994

Please sign in to comment.