public void StepThroughOnErrorIfAggregateHashUnchanged() { var pipelineHook = new AggregateStateValidator(); var aggregate = new FakeAggregate(); aggregate.UpdateHash(); pipelineHook.PostSave(aggregate, null, new InvalidOperationException()); aggregate.VerifyHash(); }
public void UpdateHashOnSuccessfulSave() { var commit = (Commit)FormatterServices.GetUninitializedObject(typeof(Commit)); var pipelineHook = new AggregateStateValidator(); var aggregate = new FakeAggregate(); aggregate.UpdateHash(); aggregate.State = Guid.NewGuid(); pipelineHook.PostSave(aggregate, commit, null); aggregate.VerifyHash(); }
public void StepThroughOnErrorIfAggregateHashUnchanged() { var pipelineHook = new AggregateStateValidator(); var aggregate = new FakeAggregate(); aggregate.UpdateHash(); pipelineHook.PostSave(aggregate, null, new InvalidOperationException()); aggregate.VerifyHash(); }
public void UpdateHashOnSuccessfulSave() { var commit = (Commit)FormatterServices.GetUninitializedObject(typeof(Commit)); var pipelineHook = new AggregateStateValidator(); var aggregate = new FakeAggregate(); aggregate.UpdateHash(); aggregate.State = Guid.NewGuid(); pipelineHook.PostSave(aggregate, commit, null); aggregate.VerifyHash(); }