Exemple #1
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);
        }
Exemple #2
0
        public void AggregateShouldHaveTheCorrectValuesWhenLoadedFromHistory()
        {
            var guid   = Guid.NewGuid();
            var events = new List <IDomainEvent>();

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

            var aggregate = new TestAggregate();

            aggregate.LoadFromHistory(events);

            aggregate.Id.Should().Be(guid);
        }