Akka.Hosting.TestKit: TestActor
is no longer the implicit sender #237
Open
Description
Version Information
Version of Akka.NET? 1.0.3
Which Akka.NET Modules? Akka.Hosting.TestKit
Describe the bug
foreach (var i in Enumerable.Range(0, 2))
{
var update1 = Dsl.Update(CounterKey, GCounter.Empty, WriteLocal.Instance,
g => g.Increment(selfAddress));
replicator.Tell(update1);
UpdateSuccess success1 = ExpectMsg<UpdateSuccess>();
}
Fails and UpdateSuccess
is a DeadLetter
- this is because ActorRefs.NoSender
is the sender.
Expected behavior
TestActor
should be the implicit sender, just like in the normal testkit.
Actual behavior
There is no implicit sender.
Workaround
Can explicitly specify the TestActor
as the sender.
foreach (var i in Enumerable.Range(0, 2))
{
var update1 = Dsl.Update(CounterKey, GCounter.Empty, WriteLocal.Instance,
g => g.Increment(selfAddress));
replicator.Tell(update1, TestActor);
UpdateSuccess success1 = ExpectMsg<UpdateSuccess>();
}