I'm finally starting to leverage the excellent Automatonymous components within MassTransit, and I'd like to TDD my way through my new state machines.
After reading over the MT docs here (http://masstransit-project.com/MassTransit/advanced/sagas/automatonymous.html) and spending some time Googling, I found unit tests right in the MT/Automatonymous Git repo that looked like the way to go:
In particular, the _machine.RaiseEvent(....)
method seemed to be exactly what I needed to be able to drive the state machine with test-provided stimuli.
Next, I went hunting for that overload... Turns out it's an extension method that appears to live here:
That's where I've gotten stuck. I'm not sure what the right way is to make use of these extension methods for testing? *.tt is a text generation template format... Are these installed as part of the nuget package? How do I gain access to the extensions? and/or more broadly, what is the recommended way to write unit tests for state machines inheriting from MassTransitStateMachine<T>
?
Follow-up question here: How to successfully drive a MassTransitStateMachine via the InMemoryTestHarness?