如何期待一些消息,并使用akka.net testkit忽略其他消息?

问题描述 投票:0回答:1

[TestMethod] [TestCategory("Integration")] public async Task Should_fetch_fund_shareclass_and_details_from_test_service() { var testIsins = new HashSet<string> {"isin1", "isin2", "isin3"}; var props = Props.Create(() => new DataFetchSupervisor()); var actor = Sys.ActorOf(props, "fetchSupervisor"); Within(TimeSpan.FromSeconds(30), () => { actor.Tell(new StartDataFetch(testIsins)); //ignore unexpected messages here var fetchComplteMsg = ExpectMsg<DataFetchComplete>(); }); }

现在,这将失败,因为我在DataFetchComplete消息之前收到了其他一些消息。
总是,请事先感谢您的任何帮助。

akka.testkit
testing akka.net
1个回答
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.