Share via


DefaultTestManager.TryGetNextEvent Method

A generated test case calls this method to get an event from the event queue. This method supports the generated test cases and is not intended to be used directly from your code.

Namespace: Microsoft.SpecExplorer.Runtime.Testing
Assembly: Microsoft.SpecExplorer.Runtime (in Microsoft.SpecExplorer.Runtime.dll)

Usage

'Usage

Syntax

'Declaration
public virtual bool TryGetNextEvent (
    TimeSpan timeOut,
    bool consume,
    out AvailableEvent availableEvent
)

Parameters

  • timeOut
    Time to wait for the event.
  • consume
    true to remove the event from the queue; otherwise, false.
  • availableEvent
    When this method returns, contains the event from the queue. This parameter is passed uninitialized.

Return Value

true if the event was available in the queue within the time-out period; otherwise, false.

Remarks

In a generated test case, an observation, either a method return or an event, is encapsulated as a transaction and can roll back or commit. If the actual observation does not match the expected one, the test case state is rolled back but the operation does not immediately result in test case failure.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003

See Also

Reference

DefaultTestManager Class
DefaultTestManager Members
Microsoft.SpecExplorer.Runtime.Testing Namespace