public void ConfirmationMessageIsDispatched_WhenStateIsNotAwaitingConfirmationMessage_ThrowException() { var processManager = Create(); var(processId, gsrnNumber, effectiveDate) = CreateTestValues(); if (processId.Value != null) { var @event = new ConfirmationMessageDispatched(processId.Value); Assert.Throws <InvalidProcessManagerStateException>(() => processManager.When(@event)); } }
public void When(ConfirmationMessageDispatched @event) { switch (_state) { case State.AwaitingConfirmationMessageDispatch: SetInternalState(State.AwaitingMeteringPointDetailsDispatch); SendCommand(new SendMeteringPointDetails(_processId !)); break; default: ThrowIfStateDoesNotMatch(@event); break; } }
public Task Handle(ConfirmationMessageDispatched notification, CancellationToken cancellationToken) { throw new System.NotImplementedException(); }