Exemplo n.º 1
0
        public void AggregateShouldClearPendingChangesWhenMarkedAsCommitted()
        {
            var aggregate = new TestAggregate(Guid.NewGuid(), String.Empty);

            aggregate.MarkChangesAsCommited();

            aggregate.HasPendingChanges().Should().Be(false);
        }
Exemplo n.º 2
0
        public void AggregateShouldHaveNoPendingChangesWhenLoadedFromHistory()
        {
            var events = new List <IDomainEvent>();

            events.Add(new TestAggregateCreatedEvent(Guid.NewGuid(), typeof(TestAggregate), String.Empty));

            var aggregate = new TestAggregate();

            aggregate.LoadFromHistory(events);

            aggregate.HasPendingChanges().Should().Be(false);
        }
Exemplo n.º 3
0
        public void AggregateShouldHavePendingChangesWhenInstanciated()
        {
            var aggregate = new TestAggregate(Guid.NewGuid(), String.Empty);

            aggregate.HasPendingChanges().Should().Be(true);
        }