如何测试该actor从调度程序接收消息

时间:2018-02-12 01:52:30

标签: c# unit-testing akka.net

创建ActorSystem并WorkerActor后,我计划每隔5分钟发送一条消息:

_actorSystem.Scheduler.ScheduleTellRepeatedly(
    TimeSpan.FromSeconds(10), TimeSpan.FromMinutes(5), 
    workerActor, new MyMessage(), Nobody.Instance);

如何使用TestKit进行测试?

我找到了这篇文章:https://petabridge.com/blog/how-to-unit-test-akkadotnet-actors-akka-testkit/

示例“我如何测试预定的消息?”在文章的最后显示了如何提前虚拟时间,使测试不等待X分钟。不幸的是,它实际上测试了演员 发送 的消息而不是 接收

0 个答案:

没有答案