TestAdapter.GetActivitySnapshot Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.