Inheritance: Regalo.Core.Event
 public bool Equals(CustomerSignedUp other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.AggregateId.Equals(AggregateId));
 }
        public void Saving_GivenSingleEvent_ShouldAllowReloading()
        {
            // Arrange
            var versionHandlerMock = new Mock<IVersionHandler>();
            IEventStore store = new RavenEventStore(_documentStore, versionHandlerMock.Object);

            // Act
            var id = Guid.NewGuid();
            var evt = new CustomerSignedUp(id);
            store.Store(id, evt);
            var events = store.Load(id);

            // Assert
            Assert.NotNull(events);
            CollectionAssert.AreEqual(
                new object[] { evt },
                events,
                "Events reloaded from store do not match those generated by aggregate.");
        }
Beispiel #3
0
 private void Apply(CustomerSignedUp evt)
 {
     Id = evt.AggregateId;
 }
Beispiel #4
0
 public bool Equals(CustomerSignedUp other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.AggregateId.Equals(AggregateId);
 }