Skip to content

Akka.TestKit: have all children of an ActorOfAsTestActorRef by TestActorRefs too #3938

@Aaronontheweb

Description

@Aaronontheweb

Version: 1.3.15

There have been a number of questions over the years regarding this, but I think I have an idea on how to solve this long-standing issue: how can I get programmatic access to child actors inside a TestKit test?

I think the answer lies in making some changes to the InternalTestActorRef interface and the TestActorCell:

protected TestActorCell GetTestActorCell()
{
return (TestActorCell)Cell;
}

I think we can expose any of the children created by an InternalTestActorRef in a collection property on the InternalTestActorRef interface itself, so any actor that was started in a unit test via the ActorOfAsTestActorRef<TActor> method will also create its children as InternalTestActorRef.

Doing this should require changing the TestActorCell.ActorOf method and the InternalTestActorRef interface mainly and would give developers underlying access to the children created by TestActorRef actors, including the Underlying actor instance too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions