예제 #1
0
        internal void AssertThatUserEmailChangedEventWasStoredOnEventStore(string userId, string userName, string newUserEmail, int version)
        {
            var userEventChangedEvent = BuildUserEmailChangedEvent(UserId.FromString(userId), userName, newUserEmail, version);

            userEventChangedEvent.Should().NotBeNull();
            var userEvents = EventStore.AllEvents(EntityId.FromString(userId));
            var userEmailChangedEventWasStoredOnEventStore = userEvents.Any(userEvent =>
            {
                return(IsOfType <UserEmailChanged>(userEvent) && AreUserEmailChangeEventsEqual(userEventChangedEvent, userEvent as UserEmailChanged));
            });

            userEmailChangedEventWasStoredOnEventStore.Should().BeTrue();
        }