public EventStoreProcess(Contacts.AccountContactSynchronizationService accountContactSynchronizationService,
      Contacts.UserContactSynchronizationService userContactSynchronizationService,
      IUserRepository userRepository)
 {
     _accountContactSynchronizationService = accountContactSynchronizationService;
     _userContactSynchronizationService = userContactSynchronizationService;
     _userRepository = userRepository;
 }
 private static AccountContactSynchronizationService CreateAccountContactSynchronizationService(
     IEventStoreClient eventStoreClient, IAccount account, IObservable<IAccountContactSummary> expectedFeed)
 {
     var dummyAccountContactProvider = CreateAccountContactProvider(account, expectedFeed);
     var accountContactsFactory = new AccountContactsFactory(eventStoreClient,
         new ConsoleLoggerFactory(),
         new[] { dummyAccountContactProvider });
     var accountContactSynchronizationService = new AccountContactSynchronizationService(eventStoreClient,
         new ConsoleLoggerFactory(),
         accountContactsFactory);
     return accountContactSynchronizationService;
 }
 public FetchUserContactProfileScenario(IEventStoreClient eventStoreClient)
 {
     _contactFeedRepository = new EventStoreContactFeedRepository(eventStoreClient, new ConsoleLoggerFactory());
     var accountFactory = new AccountFactory();
     var accountContactRefresher = new AccountContactRefresher(eventStoreClient);
     _userRepository = new UserRepository(eventStoreClient, new ConsoleLoggerFactory(), accountFactory, accountContactRefresher);
     _account = CreateAccount();
     _expectedFeed = CreateStubFeed(_account);
     _accountContactSynchronizationService = CreateAccountContactSynchronizationService(eventStoreClient, _account, _expectedFeed);
     _userContactSynchronizationService = new UserContactSynchronizationService(eventStoreClient, new ConsoleLoggerFactory());
 }
 private static AccountContactSynchronizationService CreateAccountContactSynchronizationService(
     IEventStoreClient eventStoreClient, IEnumerable<IAccountContactProvider> accountContactProviders)
 {
     var accountContactsFactory = new AccountContactsFactory(eventStoreClient,
         new ConsoleLoggerFactory(),
         accountContactProviders);
     var accountContactSynchronizationService = new AccountContactSynchronizationService(eventStoreClient,
         new ConsoleLoggerFactory(),
         accountContactsFactory);
     return accountContactSynchronizationService;
 }
            public UserAddsAccountAndContactsSynchronizeScenario(IEventStoreClient eventStoreClient)
            {
                _contactFeedRepository = new EventStoreContactFeedRepository(eventStoreClient, new ConsoleLoggerFactory());
                var accountFactory = new AccountFactory();
                var accountContactRefresher = new AccountContactRefresher(eventStoreClient);
                _userRepository = new UserRepository(eventStoreClient, new ConsoleLoggerFactory(), accountFactory, accountContactRefresher);
                _initialAccount = CreateAccount("main");
                _initialAccountContactFeed = new[] { Alex(_initialAccount), Billy(_initialAccount), Charlie(_initialAccount) }.ToObservable();

                _newAccount = CreateAccount("other", "OtherProvider");
                _newAccountContactFeed = new[] { Alex(_newAccount), Derek(_newAccount) }.ToObservable();

                var accContactProviders = new[]
                {
                    CreateAccountContactProvider(_initialAccount, _initialAccountContactFeed),
                    CreateAccountContactProvider(_newAccount, _newAccountContactFeed),
                };

                _accountContactSynchronizationService = CreateAccountContactSynchronizationService(eventStoreClient, accContactProviders);
                _userContactSynchronizationService = new UserContactSynchronizationService(eventStoreClient, new ConsoleLoggerFactory());
            }
 public UserRegistrationAccountContactSynchronizationScenario(IEventStoreClient eventStoreClient)
 {
     _contactFeedRepository = new EventStoreContactFeedRepository(eventStoreClient, new ConsoleLoggerFactory());
     var accountFactory = new AccountFactory();
     var accountContactRefresher = new AccountContactRefresher(eventStoreClient);
     _userRepository = new UserRepository(eventStoreClient, new ConsoleLoggerFactory(), accountFactory, accountContactRefresher);
     _account = CreateAccount("*****@*****.**");
     _expectedFeed = new[] { Alex(_account), Billy(_account), Charlie(_account) }.ToObservable();
     var accContactProviders = new[] { CreateAccountContactProvider(_account, _expectedFeed) };
     _accountContactSynchronizationService = CreateAccountContactSynchronizationService(eventStoreClient, accContactProviders);
     _userContactSynchronizationService = new UserContactSynchronizationService(eventStoreClient, new ConsoleLoggerFactory());
 }