Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spec for handling delegates in DI #4922

Prev Previous commit
Next Next commit
Make sure spec exits cleanly by terminating the actor system.
  • Loading branch information
Arkatufus committed Apr 8, 2021
commit 1d7f8759320767d7192b11be6534af79c168486b
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ public DelegateInjectionSpecs(ITestOutputHelper output) : base(output)
}

[Fact]
public void DI_should_be_able_to_retrieve_singleton_using_delegate()
public async Task DI_should_be_able_to_retrieve_singleton_using_delegate()
{
var actor = _serviceProvider.GetRequiredService<EchoActorProvider>()();

var task = actor.Ask("echo");
task.Wait(TimeSpan.FromSeconds(3));
task.Result.ShouldBe("echo");

var sys = _serviceProvider.GetRequiredService<AkkaService>().ActorSystem;
await sys.Terminate();
}

internal class EchoActor : ReceiveActor
Expand Down