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

Malotho/making actors unit testable #220

Conversation

malotho-zz
Copy link

@malotho-zz malotho-zz commented Feb 13, 2020

Description

I have changed the constructor on the Actor class to take an optional IActorStateManager.
The constructor will use the provided IActorStateManager if passed, otherwise a new actorstatemanager instance will be created.

Please reference the issue this PR will close: #173

This is to verify that there are no breaking changes, and that the actor class can take any ActorStateManager.
@msftclas
Copy link

msftclas commented Feb 13, 2020

CLA assistant check
All CLA requirements met.

@amanbha amanbha merged commit 1bacce6 into dapr:master Feb 14, 2020
@amanbha
Copy link
Contributor

amanbha commented Feb 15, 2020

@malotho I will be reverting the changes in this PR as its causing a null reference exception. ActorStateManager is trying to use ActorService before its assigned. Please prepare another PR with the fixes.

== APP == ---> System.NullReferenceException: Object reference not set to an instance of an object.
== APP == at Dapr.Actors.Runtime.ActorStateManager..ctor(Actor actor) in E:\github\dapr\dotnet-sdk\src\Dapr.Actors\Runtime\ActorStateManager.cs:line 24

== APP == at Dapr.Actors.Runtime.Actor..ctor(ActorService actorService, ActorId actorId, IActorStateManager actorStateManager) in E:\github\dapr\dotnet-sdk\src\Dapr.Actors\Runtime\Actor.cs:line 39

== APP == at DaprDemoActor.DemoActor..ctor(ActorService service, ActorId actorId) in E:\github\dapr\dotnet-sdk\samples\Actor\DemoActor\DemoActor.cs:line 31

== APP == --- End of inner exception stack trace ---

amanbha added a commit that referenced this pull request Feb 15, 2020
@amanbha amanbha changed the title Malotho/making actorstestable Malotho/making actors unit testable Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to create unit tests for Actors
4 participants