mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Reorganize tests
- Pester source code moved to `test/Pester`, deleted `ext-src`. - Pester tests (.ps1 files) moved to `test/powershell` - xUnit tests (.cs files) moved to `test/csharp` - Third-party script test moved to `test/shebang`
This commit is contained in:
1 parent
ec08d9f46c
commit
bbebf2f76a
105 files changed
+1
-1
No files matched your search
@@ -0,0 +1,38 @@
|
||||
Describe "Remove-Event" {
|
||||
|
||||
BeforeEach{
|
||||
New-Event -sourceidentifier PesterTimer -sender windows.timer -messagedata "PesterTestMessage"
|
||||
}
|
||||
|
||||
AfterEach{
|
||||
Remove-Event -sourceidentifier PesterTimer -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
Context "Check Remove-Event can validly remove events" {
|
||||
|
||||
It "Should remove an event given a sourceidentifier" {
|
||||
{ Remove-Event -sourceidentifier PesterTimer }
|
||||
{ Get-Event -ErrorAction SilentlyContinue | Should Not Contain PesterTimer }
|
||||
}
|
||||
|
||||
It "Should remove an event given an event identifier" {
|
||||
{ $events = Get-Event -sourceidentifier PesterTimer }
|
||||
{ $events = $events.EventIdentifier }
|
||||
{ Remove-Event -EventIdentifier $events }
|
||||
{ $events = Get-Event -ErrorAction SilentlyContinue}
|
||||
{ $events.SourceIdentifier | Should Not Contain "PesterTimer" }
|
||||
}
|
||||
|
||||
It "Should be able to remove an event given a pipe from Get-Event" {
|
||||
{ Get-Event -sourceidentifier PesterTimer | Remove-Event }
|
||||
{ Get-Event -ErrorAction SilentlyContinue | Should Not Contain "PesterTimer" }
|
||||
|
||||
}
|
||||
|
||||
It "Should NOT remove an event given the whatif flag" {
|
||||
{ Remove-Event -sourceidentifier PesterTimer -whatif }
|
||||
{ $events = Get-Event }
|
||||
{ $events.SourceIdentifier | Should Contain "PesterTimer" }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user