You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing unit tests for a class that performs some grain calls its currently impossible if the extension method AsReference is used.
This problem doesnt arise when just using GetGrain to access the grain as there we can easily return a mocked version of the grain interface.
Ideally I would like to be able to unit test services that rely on grain calls easily without having to use an in memory cluster or any other complicated mock setups. The fact orleans relies on interfaces makes this very easy except for when relying on AsReference casts to get an IAddressable.
Below is a simple example that demonstrates the problem
When writing unit tests for a class that performs some grain calls its currently impossible if the extension method
AsReference
is used.This problem doesnt arise when just using
GetGrain
to access the grain as there we can easily return a mocked version of the grain interface.Ideally I would like to be able to unit test services that rely on grain calls easily without having to use an in memory cluster or any other complicated mock setups. The fact orleans relies on interfaces makes this very easy except for when relying on
AsReference
casts to get anIAddressable
.Below is a simple example that demonstrates the problem
The text was updated successfully, but these errors were encountered: