Beispiel #1
0
        protected override void ConfigureApplicationContainer(TinyIoCContainer container)
        {
            base.ConfigureApplicationContainer(container);

            var eventsStore = new EventsStore();

            var sessionsRepository        = new SessionsRepository(eventsStore);
            var timelineMessageRepository = new TimelineMessageRepository();
            var followersRepository       = new FollowersRepository();
            var subscriptionsRepository   = new SubscriptionsRepository(eventsStore, followersRepository);

            var eventPublisher            = new EventPublisher();
            var eventPublisherWithStorage = new EventPublisherWithStorage(eventsStore, eventPublisher);

            eventPublisher.Subscribe(new SessionHandler(sessionsRepository));
            eventPublisher.Subscribe(new UpdateTimeline(timelineMessageRepository));
            eventPublisher.Subscribe(new NotifyFollowerOfFolloweeMessage(followersRepository, subscriptionsRepository, eventPublisherWithStorage));
            eventPublisher.Subscribe(new UpdateFollowers(followersRepository));

            container.Register <IEventPublisher>(eventPublisherWithStorage);
            container.Register <IUserIdentitiesRepository>(new UserIdentitiesRepository(eventsStore));
            container.Register <ISessionsRepository>(sessionsRepository);
            container.Register <ITimelineMessageRepository>(timelineMessageRepository);
            container.Register <IMessagesRepository>(new MessagesRepository(eventsStore));
        }
        public FollowersRepositoryTests()
        {
            var factory = new EventStoreFactory();

            factory.EnsureEventStoreIsCreated();
            _documentSession = factory.DocumentSession();
            _repository      = new FollowersRepository(_documentSession);
        }
        public NotifyFollowerOfFolloweeMessageTest()
        {
            _eventsStore         = new EventsStore();
            _followersRepository = new FollowersRepository();
            var subscriptionsRepository = new SubscriptionsRepository(_eventsStore, _followersRepository);

            _eventPublisher = new EventPublisherFake();
            _handler        = new NotifyFollowerOfFolloweeMessage(_followersRepository, subscriptionsRepository, _eventPublisher);
        }
 public UpdateFollowersTest()
 {
     _followersRepository = new FollowersRepository();
     _handler             = new UpdateFollowers(_followersRepository);
 }
 public FollowersRepositoryTest()
 {
     _repository = new FollowersRepository();
 }
Beispiel #6
0
 public SubscriptionsRepositoryTest()
 {
     _eventsStore             = new EventsStore();
     _followersRepository     = new FollowersRepository();
     _subscriptionsRepository = new SubscriptionsRepository(_eventsStore, _followersRepository);
 }