public void StepThroughIfAggregateHashUnchanged()
            {
                var pipelineHook = new AggregateStateValidator();
                var aggregate = new FakeAggregate();

                aggregate.UpdateHash();

                pipelineHook.PreSave(aggregate, null);
            }
Esempio n. 2
0
            public void StepThroughIfAggregateHashUnchanged()
            {
                var pipelineHook = new AggregateStateValidator();
                var aggregate    = new FakeAggregate();

                aggregate.UpdateHash();

                pipelineHook.PreSave(aggregate, null);
            }
            public void ThrowMemberAccessExceptionIfHashInvalid()
            {
                var pipelineHook = new AggregateStateValidator();
                var aggregate = new FakeAggregate();

                aggregate.UpdateHash();
                aggregate.State = Guid.NewGuid();

                Assert.Throws<MemberAccessException>(() => pipelineHook.PostGet(aggregate));
            }
Esempio n. 4
0
            public void ThrowMemberAccessExceptionIfHashInvalid()
            {
                var pipelineHook = new AggregateStateValidator();
                var aggregate    = new FakeAggregate();

                aggregate.UpdateHash();
                aggregate.State = Guid.NewGuid();

                Assert.Throws <MemberAccessException>(() => pipelineHook.PreSave(aggregate, null));
            }
Esempio n. 5
0
            public void StepThroughOnErrorIfAggregateHashUnchanged()
            {
                var pipelineHook = new AggregateStateValidator();
                var aggregate    = new FakeAggregate();

                aggregate.UpdateHash();

                pipelineHook.PostSave(aggregate, null, new InvalidOperationException());

                aggregate.VerifyHash();
            }
Esempio n. 6
0
            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();
            }
            public void ThrowMemberAccessExceptionOnErrorIfHashInvalid()
            {
                var pipelineHook = new AggregateStateValidator();
                var aggregate = new FakeAggregate();

                aggregate.UpdateHash();
                aggregate.State = Guid.NewGuid();

                Assert.Throws<MemberAccessException>(() => pipelineHook.PostSave(aggregate, null, new InvalidOperationException()));
            }