我有一个演员通过向其父母发送消息来响应消息,就像这样......
public void Handle(string message)
{
Context.Parent.Tell("Hello");
}
我现在想测试消息是否已发送到 Actors 父级,但不知道如何发送。我当前的测试如下所示...
pubilc void AllResponsesWillGoToParent()
{
ActorOf<MyActor>().Tell("Respond to parent");
ExpectMsg<string>(x => x == "Hello");
}
这当然行不通,因为 Actor 父级是测试 ActorSystem 而不是分配给 TestActor 属性的 Actor。
有谁知道我如何测试消息确实发送给它的父母,谢谢。