public void AggregatorMachine_OnHand_Shipment_Moves_Aggregating() { var machine = new AggregatorMachine(); IEvent onHandEvent = new OnHandEvent { Data = "Hello " }; IEvent shipmentEvent = new ShipmentEvent { Data = "world!" }; machine.MoveNext(onHandEvent); machine.MoveNext(shipmentEvent); Assert.Equal(AggregatorState.Resolved, machine.CurrentState); }
public void AggregatorMachine_Resolve_Moves_From_Resolved_Error() { var machine = new AggregatorMachine(); IEvent onHandEvent = new OnHandEvent { Data = "Hello " }; IEvent shipmentEvent = new ShipmentEvent { Data = "world!" }; IEvent resolveEvent = new ResolveEvent { Data = "Hello world?" }; machine.MoveNext(onHandEvent); machine.MoveNext(shipmentEvent); Assert.Throws <Exception>(() => machine.MoveNext(resolveEvent)); }
public void AggregatorMachine_Resolve_from_Inactive_Error() { var machine = new AggregatorMachine(); IEvent resolveEvent = new ResolveEvent { Data = "Hello world?" }; Assert.Throws <Exception>(() => machine.MoveNext(resolveEvent)); }
public void AggregatorMachine_Shipment_Moves_Aggregating() { var machine = new AggregatorMachine(); IEvent e = new ShipmentEvent { Data = "world!" }; machine.MoveNext(e); Assert.Equal(AggregatorState.Aggregating, machine.CurrentState); }
public void AggregatorMachine_OnHand_Moves_Aggregating() { var machine = new AggregatorMachine(); IEvent e = new OnHandEvent { Data = "Hello " }; machine.MoveNext(e); Assert.Equal(AggregatorState.Aggregating, machine.CurrentState); }