From 121ceb96446028ca635d3dd39b5d2c9be265e245 Mon Sep 17 00:00:00 2001 From: Ebere Abanonu Date: Wed, 30 Mar 2022 16:49:50 +0100 Subject: [PATCH] Port `Akka.Tests.Actor` tests to `async/await` - `SystemGuardianTests` (#5786) --- src/core/Akka.Tests/Actor/SystemGuardianTests.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/Akka.Tests/Actor/SystemGuardianTests.cs b/src/core/Akka.Tests/Actor/SystemGuardianTests.cs index 18adec83e7a..901ed9c66f4 100644 --- a/src/core/Akka.Tests/Actor/SystemGuardianTests.cs +++ b/src/core/Akka.Tests/Actor/SystemGuardianTests.cs @@ -5,6 +5,7 @@ // //----------------------------------------------------------------------- +using System.Threading.Tasks; using Akka.Actor; using Akka.Dispatch.SysMsg; using Akka.TestKit; @@ -26,29 +27,29 @@ public SystemGuardianTests() } [Fact] - public void Should_Send_Hook_When_UserGuardian_Terminated() + public async Task Should_Send_Hook_When_UserGuardian_Terminated() { _systemGuardian.Tell(RegisterTerminationHook.Instance); _userGuardian.Tell(PoisonPill.Instance); - ExpectMsg(); + await ExpectMsgAsync(); } [Fact] - public void Should_Terminate_When_Hooks_Complete() + public async Task Should_Terminate_When_Hooks_Complete() { var probe = CreateTestProbe(); probe.Watch(_systemGuardian); _systemGuardian.Tell(RegisterTerminationHook.Instance); _userGuardian.Tell(PoisonPill.Instance); - ExpectMsg(); + await ExpectMsgAsync(); _systemGuardian.Tell(TerminationHookDone.Instance); - probe.ExpectTerminated(_systemGuardian); + await probe.ExpectTerminatedAsync(_systemGuardian); } [Fact] - public void Should_Remove_Registration_When_Registree_Terminates() + public async Task Should_Remove_Registration_When_Registree_Terminates() { var guardianWatcher = CreateTestProbe(); guardianWatcher.Watch(_systemGuardian); @@ -59,7 +60,7 @@ public void Should_Remove_Registration_When_Registree_Terminates() _userGuardian.Tell(PoisonPill.Instance); - guardianWatcher.ExpectTerminated(_systemGuardian); + await guardianWatcher.ExpectTerminatedAsync(_systemGuardian); } } }