OrleansContrib / OrleansTestKit

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

GrainType on GrainId is duplicate of GrainIdentity #140

Closed Romanx closed 1 year ago

Romanx commented 1 year ago

The GrainType value of the GrainId is the same value as the grain key so if you're expecting a type you'd get an incorrect value.

Orleans resolves this value via the grain interface although you can use the GrainTypeResolver to take the Type of the grain and parse the GrainType correctly.

I've submitted a PR with a fix, since there's a dependency tree to construct a GrainTypeResolver I've been lazy and used a DI container to correctly resolve this using the Orleans methods since some of the dependencies are internal to Orleans. This could probably be cached but i noticed all dependencies in TestKit are rooted to the silo instance so kept this the same.