Sample-ShoppingWeb
Sample-ShoppingWeb copied to clipboard
Add unittests to the sample
It would be very useful to have unittests for the sample.
I for example used the shoppingcart saga example to create my own saga. And like every good programmer ;) I would like to create unittests for it. But there are none in the example. Neither are there in the MassTransit sources or in the Automatonymous project.
And from the looks of it, unittesting a saga isn't very trivial, and I would need some harness to test it.
There are dozens of unit tests on the state machine sagas in the MassTransit repository:
https://github.com/MassTransit/MassTransit/tree/develop/src/MassTransit.AutomatonymousIntegration.Tests
@phatboyg I think this is a wrong answer, as the unit tests at the link you provided test Automatonymous functionality, they do not provide an example on how to unit test your own Automatonymous state machine. I'd actually need the same: unit testing my saga in an MsTest environment, have been searching the web for quite a while now, but didn't come up with anything :-(
Implemented an example here: https://github.com/balintn22/AutomatonymousTestExample