diff --git a/src/core/Akka.Tests/Dispatch/AsyncAwaitSpec.cs b/src/core/Akka.Tests/Dispatch/AsyncAwaitSpec.cs index 50ff04a276d..7798798dccd 100644 --- a/src/core/Akka.Tests/Dispatch/AsyncAwaitSpec.cs +++ b/src/core/Akka.Tests/Dispatch/AsyncAwaitSpec.cs @@ -331,11 +331,11 @@ public async Task Actors_should_be_able_to_block_ask_self_message_loop() } [Fact] - public void Actors_should_be_able_to_supervise_async_exceptions() + public async Task Actors_should_be_able_to_supervise_async_exceptions() { var asker = Sys.ActorOf(Props.Create(() => new AsyncExceptionActor(TestActor))); asker.Tell("start"); - ExpectMsg("done", TimeSpan.FromSeconds(5)); + await ExpectMsgAsync("done", TimeSpan.FromSeconds(5)); } [Fact] @@ -347,11 +347,11 @@ public async Task Actors_should_be_able_to_use_ContinueWith() } [Fact] - public void Actors_should_be_able_to_supervise_exception_ContinueWith() + public async Task Actors_should_be_able_to_supervise_exception_ContinueWith() { var asker = Sys.ActorOf(Props.Create(() => new AsyncTplExceptionActor(TestActor))); asker.Tell("start"); - ExpectMsg("done", TimeSpan.FromSeconds(5)); + await ExpectMsgAsync("done", TimeSpan.FromSeconds(5)); } @@ -378,12 +378,12 @@ public async Task Actor_should_be_able_to_resume_suspend() } [Fact] - public void Actor_should_be_able_to_ReceiveTimeout_after_async_operation() + public async Task Actor_should_be_able_to_ReceiveTimeout_after_async_operation() { var actor = Sys.ActorOf(); actor.Tell("hello"); - ExpectMsg(m => m == "GotIt"); + await ExpectMsgAsync(m => m == "GotIt"); } public class AsyncExceptionCatcherActor : ReceiveActor @@ -448,13 +448,13 @@ private static void ThrowException() } [Fact] - public void Actor_PreRestart_should_give_the_failing_message() + public async Task Actor_PreRestart_should_give_the_failing_message() { var actor = Sys.ActorOf(); actor.Tell("hello"); - ExpectMsg(m => "hello".Equals(m.Message)); + await ExpectMsgAsync(m => "hello".Equals(m.Message)); } public class AsyncPipeToDelayActor : ReceiveActor @@ -494,21 +494,21 @@ public AsyncReentrantActor() } [Fact] - public void ActorTaskScheduler_reentrancy_should_not_be_possible() + public async Task ActorTaskScheduler_reentrancy_should_not_be_possible() { var actor = Sys.ActorOf(); actor.Tell("hello"); - ExpectNoMsg(1000); + await ExpectNoMsgAsync(1000); } [Fact] - public void Actor_PipeTo_should_not_be_delayed_by_async_receive() + public async Task Actor_PipeTo_should_not_be_delayed_by_async_receive() { var actor = Sys.ActorOf(); actor.Tell("hello"); - ExpectMsg(m => "hello".Equals(m), TimeSpan.FromMilliseconds(1000)); + await ExpectMsgAsync(m => "hello".Equals(m), TimeSpan.FromMilliseconds(1000)); } [Fact] @@ -517,13 +517,13 @@ public async Task Actor_receiveasync_overloads_should_work() var actor = Sys.ActorOf(); actor.Tell(11); - ExpectMsg(m => "handled".Equals(m), TimeSpan.FromMilliseconds(1000)); + await ExpectMsgAsync(m => "handled".Equals(m), TimeSpan.FromMilliseconds(1000)); actor.Tell(9); - ExpectMsg(m => "receiveany".Equals(m), TimeSpan.FromMilliseconds(1000)); + await ExpectMsgAsync(m => "receiveany".Equals(m), TimeSpan.FromMilliseconds(1000)); actor.Tell(1.0); - ExpectMsg(m => "handled".Equals(m), TimeSpan.FromMilliseconds(1000)); + await ExpectMsgAsync(m => "handled".Equals(m), TimeSpan.FromMilliseconds(1000)); }