OrleansContrib / OrleansTestKit

Unit Test Toolkit for Microsoft Orleans
http://dotnet.github.io/orleans
MIT License
78 stars 43 forks source link

GrainContext unavailable in constructor #134

Closed cmeyertons closed 9 months ago

cmeyertons commented 1 year ago

When CreateGrainInstance is invoked here, the grain context is not available via ambient context like it is inside the Orleans Framework.

There are scenarios where you want to do something simple in the constructor to convey better intent (such as deconstructing the GrainId into a readonly field) that would be preferred over OnActivateAsync

This would require a change from Orleans to publicize a mechanism to make the RuntimeContext more testable.

cmeyertons commented 1 year ago

135 will address this -- setting the RuntimeContext via reflection instead of setting backing fields afterwards