private void before_each() { var embeddedNode = EmbeddedEventStore.Start(); var embeddedConnection = EmbeddedEventStoreConnection.Create(embeddedNode); embeddedConnection.ConnectAsync().Wait(); var eventSerializerStub = new EventSerializerStub(); var eventHandlerMock = new EventHandlerMock(); var sut = new EventStoreSubscriptionStarter(new EventSerializerStub(), eventHandlerMock); _node = embeddedNode; _connection = embeddedConnection; _serializer = eventSerializerStub; _eventHandler = eventHandlerMock; _sut = sut; }
private void before_each() { var node = EmbeddedEventStore.Start(); var connectionSettings = ConnectionSettings .Create() .SetDefaultUserCredentials(new UserCredentials("admin", "changeit")); var connection = EmbeddedEventStoreConnection.Create(node, connectionSettings); connection.ConnectAsync().Wait(); var eventSerializer = new EventSerializer(); var userRegistrationProcessRepository = new UserRegistrationProcessRepository(connection, eventSerializer); var userByEmailInMemoryIndex = new UserByEmailIndex(connection, eventSerializer); var commandService = new UserRegistrationCommandService(userRegistrationProcessRepository); var queryService = new UserRegistrationQueryService(userRegistrationProcessRepository); var userRepository = new UserRepository(connection, eventSerializer); var userRegistrationEventHandler = new UserRegistrationEventHandler( userRegistrationProcessRepository, userRepository, userByEmailInMemoryIndex); var userRegistrationEventHandlerAdapter = new UserRegistrationEventHandlerAdapter(userRegistrationEventHandler); var subscriptionStarter = new EventStoreSubscriptionStarter(eventSerializer, userRegistrationEventHandlerAdapter); var subscription = subscriptionStarter.Start(connection); _node = node; _connection = connection; _commandService = commandService; _queryService = queryService; _subscription = subscription; }