Hi!
Gishu, maybe I misunderstood your problem, but there is a possible solution.
In this test, I have an actor (a la Akka/Scala actor), that receive messages, in a parallel thread. The process of the message is written in a lambda C# expression: it increments a shared counter, and then, set on a wait handle.
The test body creates and launches the actor. Send it a message. Wait the shared handle. AND THEN, it tests the shared total.
In this simple I case, I could ignore the total. But I use the total trick in other test, like
to check the process of many messages.
I could add a TryWait, instead of Wait, in case I want to raise an Assert.Fail() if the try wait timeout
Angel "Java" Lopez
@ajlopez