ภาษา

TestAdapter.GetActivitySnapshot Method

Definition

Returns a thread-safe snapshot of the current contents of the ActiveQueue.

public Microsoft.Agents.Core.Models.IActivity[] GetActivitySnapshot();
member this.GetActivitySnapshot : unit -> Microsoft.Agents.Core.Models.IActivity[]
Public Function GetActivitySnapshot () As IActivity()

Returns

An array copy of the activities currently queued.

Remarks

Enqueues happen under an internal lock, but the ActiveQueue property itself is not safe to enumerate directly while another thread (e.g. a background worker) is sending activities. Use this method to inspect the queue from tests that run concurrently with a producer to avoid "Collection was modified" enumeration errors.

Applies to