public void GivenUserFollowedWhenGetSubscriptionThenReturnSubscriptionAggregate() { _eventsStore.Store(new UserFollowed(SubscriptionId)); var subscription = _subscriptionsRepository.GetSubscription(SubscriptionId); var eventPublisher = new EventPublisherFake(); subscription.Unfollow(eventPublisher); Check.That(eventPublisher.Events).ContainsExactly(new UserUnfollowed(SubscriptionId)); }
public void GivenMessageQuackedThenGetMessageThenReturnTheMessage() { var messageQuacked = new MessageQuacked(MessageId.Generate(), new UserId("*****@*****.**"), "Hello"); _eventsStore.Store(messageQuacked); var message = _repository.Get(messageQuacked.Id); var eventsPublisher = new EventPublisherFake(); message.Requack(eventsPublisher, new UserId("*****@*****.**")); Check.That(eventsPublisher.Events.Cast <MessageRequacked>().Single().Id).IsEqualTo(messageQuacked.Id); }
public void GivenUserRegisteredWhenGetUserIdentityThenReturnUserIdentityAggregate() { _eventStore.Store(new UserRegistered(UserId)); var user = _repository.GetUserIdentity(UserId); Check.That(user).IsNotNull(); }
public void GivenUserConnectedWhenGetSessionThenReturnSessionAggregate() { _eventsStore.Store(new UserConnected(SessionId, UserId, DateTime.Now)); var session = _repository.GetSession(SessionId); Check.That(session).IsNotNull(); }
private void AddFollower(SubscriptionId subscriptionId) { _followersRepository.Save(new FollowerProjection(SubscriptionId.Followee, subscriptionId.Follower)); _eventsStore.Store(new UserFollowed(subscriptionId)); }