Esempio n. 1
0
 public EventStoreProcess(Contacts.AccountContactSynchronizationService accountContactSynchronizationService,
      Contacts.UserContactSynchronizationService userContactSynchronizationService,
      IUserRepository userRepository)
 {
     _accountContactSynchronizationService = accountContactSynchronizationService;
     _userContactSynchronizationService = userContactSynchronizationService;
     _userRepository = userRepository;
 }
            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 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());
 }
 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());
 }