예제 #1
0
        private async Task<IEnumerable<IAggregateEvent>> MakeExpectedChanges(CounterStats expected)
        {
            var counter = new Sample.Counter(AggregateId, new Sample.CounterState());

            for (var i = 0; i < expected.NumberOfIncrements; ++i)
            {
                counter.Increment();
            }

            for (var i = 0; i < expected.NumberOfMultiplications; ++i)
            {
                counter.Multiply(1);
            }

            for (var i = 0; i < expected.NumberOfResets; ++i)
            {
                counter.Reset();
            }
            await this.eventStore.Append(AggregateId, 0, counter.Changes);

            return counter.Changes;
        }
예제 #2
0
        private async Task <IEnumerable <IAggregateEvent> > MakeExpectedChanges(CounterStats expected)
        {
            var counter = new Sample.Counter(AggregateId, new Sample.CounterState());

            for (var i = 0; i < expected.NumberOfIncrements; ++i)
            {
                counter.Increment();
            }

            for (var i = 0; i < expected.NumberOfMultiplications; ++i)
            {
                counter.Multiply(1);
            }

            for (var i = 0; i < expected.NumberOfResets; ++i)
            {
                counter.Reset();
            }
            await this.eventStore.Append(AggregateId, 0, counter.Changes);

            return(counter.Changes);
        }