Ejemplo n.º 1
0
        public void Create_Aggregate_By_Applying_Events()
        {
            var @events = new List <DomainEvent>()
            {
                new UserRegistered(1, "fatemeh76", "fatemeh", "shahidani"),
                new UserAccountActivated(1)
            };

            var aggregateFactory = new AggregateFactory();
            var aggregate        = aggregateFactory.Reconstruct <User>(@events);

            Assert.Equal("fatemeh", aggregate.FirstName);
            Assert.Equal("shahidani", aggregate.LastName);
            Assert.Equal("fatemeh76", aggregate.Username);
        }