Open Johanny opened 5 years ago
This is very similar to #55. We can support constructor injection of ITransactionalState<TState>
mock objects by registering our own implementation of IAttributeToFactoryMapper<TransactionalStateAttribute>
in the silo's dependency injection container.
Any progress on this? Would be a great feature!
@erikljung Not directly. I have a branch that adds the needed support for constructor injection, but I've only applied it to the state facet interfaces/classes.
Since the release of Orleans 2.1.0 grains now support transactions.
For a grain to use transactions it should be instanciated with a
ITransactionalState<TState>
facet:It would be great to be able to unit test grain with a transactionnal state facet with the test kit. Right now trying to get a grain with a
ITransactionalState<TState>
facet like so:Is throwing this exception:
Here is a naive implementation that fulfil the
ITransactionalState
interface and enable testing such grains:Standalone usage example:
This implementation works but something integrated to the test kit would be better.