automatonymous

How to write MassTransitStateMachine unit tests?

穿精又带淫゛_ 提交于 2019-12-23 23:05:48
问题 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: https://github.com/MassTransit/Automatonymous/blob/master/src/Automatonymous.Tests/Condition_Specs.cs#L21

Handling transition to state for multiple events

为君一笑 提交于 2019-12-22 07:36:11
问题 I have a MassTransitStateMachine that orchestrates a process which involves creating multiple events. Once all of the events are done, I want the state to transition to a 'clean up' phase. Here is the relevant state declaration and filter function: During(ImportingData, When(DataImported) // When we get a data imported event, mark this source as done. .Then(MarkImportCompletedForLocation), When(DataImported, IsAllDataImported) // Once all are done, we can transition to cleaning up... .Then

How to successfully drive a MassTransitStateMachine via the InMemoryTestHarness?

佐手、 提交于 2019-12-14 04:27:12
问题 Following up to: How to write MassTransitStateMachine unit tests? Here's a simple test class (using MS Test) for a simple state machine called ProcedureStateMachine (note: this is not a real production state machine for us... just an experiment I'd used to play around with MassTransitStateMachine a while back.. it seemed a handy self-contained place to experiment with getting unit testing going too): [TestClass] public class ProcedureStateMachineTests { private ProcedureStateMachine _machine;

MassTransit saga with Redis persistence gives Method Accpet does not have an implementation exception

跟風遠走 提交于 2019-12-11 17:34:29
问题 I'm trying to add Redis persistence to my saga which is managing calls to a routing slip (as well as additional messages to other consumers depending on the result of the routing slip) in the hopes that it will solve another timeout issue I keep getting. However, I get an error message which goes in to my saga_error queue in RabbitMQ. The error shown in the message is: Method 'Accept' in type 'GreenPipes.DynamicInternal.Automatonymous.State' from assembly 'AutomatonymousGreenPipes

Combine to Whens in Automatonymous state machine

非 Y 不嫁゛ 提交于 2019-12-10 22:48:51
问题 I am making a Request from MassTransit state machine saga and wait for reply. But there could be two errors coming back to me: MyRequest.TimeoutExpired MyRequest.Faulted I don't care on which conditions the request was not fulfilled, I want both situations to result in an error message to be published. However, I could not find any way to combine two outcomes with or condition, so I can have one handling case for both outcomes and not copy-paste my code. 回答1: In this case, you should either

Handling transition to state for multiple events

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 05:58:16
I have a MassTransitStateMachine that orchestrates a process which involves creating multiple events. Once all of the events are done, I want the state to transition to a 'clean up' phase. Here is the relevant state declaration and filter function: During(ImportingData, When(DataImported) // When we get a data imported event, mark this source as done. .Then(MarkImportCompletedForLocation), When(DataImported, IsAllDataImported) // Once all are done, we can transition to cleaning up... .Then(CleanUpSources) .TransitionTo(CleaningUp) ); ...snip... private static bool IsAllDataImported