public void Cell_should_clear_current_message_after_receive()
{
AutoResetEvent autoResetEvent = new AutoResetEvent(false);
var actor = Sys.ActorOf(Props.Create(() => new DummyActor(autoResetEvent)));
actor.Tell("hello");
//ensure the message was received
autoResetEvent.WaitOne();
var refCell = actor as ActorRefWithCell;
var cell = refCell.Underlying as ActorCell;
//wait while current message is not null (that is, receive is not yet completed/exited)
SpinWait.SpinUntil(() => cell.CurrentMessage == null, TimeSpan.FromSeconds(2));
cell.CurrentMessage.ShouldBe(null);
}