MegaBites-AI/Windows-powershell
0372
1# Copyright (c) Microsoft Corporation.2# Licensed under the MIT License.3Describe "Wait-Event" -Tags "CI" {4 5 Context "Validate Wait-Event is waiting for events" {6 It "Should time out when it does not receive a FakeEvent" {7 # Don't depend on Measure-Command8$stopwatch = [System.Diagnostics.Stopwatch]::startNew()9# Testing the timeout, so wait for an event that will never be10# raised because it is fake11Wait-Event -Timeout 1 -SourceIdentifier "FakeEvent"12$stopwatch.Stop()13$stopwatch.ElapsedMilliseconds | Should -BeGreaterThan 50014$stopwatch.ElapsedMilliseconds | Should -BeLessThan 150015}16}17}18 