public void GetClient_WhenNoDefaultTimeoutIsConfigured_TheClientShouldBe100Seconds()
        {
            _connection = EventStoreHttpConnection.Create(ConnectionSettings.Default, Endpoint);

            var client = _connection.GetClient();
            client.Timeout.Should().Be(TimeSpan.FromSeconds(100));
        }
Beispiel #2
0
        public void GetClient_WhenNoDefaultTimeoutIsConfigured_TheClientShouldBe100Seconds()
        {
            _connection = EventStoreHttpConnection.Create(ConnectionSettings.Default, Endpoint);

            var client = _connection.GetClient();

            client.Timeout.Should().Be(TimeSpan.FromSeconds(100));
        }
        public void GetHandler_WhenNoDefaultCredentialsAreConfigured_TheClientShouldNotHaveAnyCredentials()
        {
            var settings = new ConnectionSettingsBuilder().WithHttpClientProxy(_httpClientProxyMock.Object);
            _connection = EventStoreHttpConnection.Create(settings, Endpoint);

            var handler = _connection.GetHandler();
            handler.Credentials.Should().BeNull();
        }
Beispiel #4
0
        public void GetHandler_WhenNoDefaultCredentialsAreConfigured_TheClientShouldNotHaveAnyCredentials()
        {
            var settings = new ConnectionSettingsBuilder().WithHttpClientProxy(_httpClientProxyMock.Object);

            _connection = EventStoreHttpConnection.Create(settings, Endpoint);

            var handler = _connection.GetHandler();

            handler.Credentials.Should().BeNull();
        }
        public EventStoreAuditService(TopicSubscriberService subscriberService, AmazonSQSClient sqsClient, ISettings settings)
        {
            _subscriberService = subscriberService;
            _eventStore        = EventStoreHttpConnection.Create(ConnectionSettings.Default,
                                                                 string.Format("http://{0}:{1}", settings.Address, settings.HttpPort));

            _sqsClient          = sqsClient;
            _eventStoreQueueUrl = settings.QueueUrl;

            _timer = new Timer
            {
                AutoReset = true,
                Interval  = settings.TimeSpanPolling.TotalMilliseconds
            };

            _timer.Elapsed += TopicSubscriptionTimeoutElapsed;
            _timer.Start();
        }
        //[Test]
        public async void Test()
        {
            var connection = EventStoreHttpConnection.Create(new ConnectionSettingsBuilder(), "http://127.0.0.1:2113");
            var resolver   = new Mock <IEventHandlerResolver>();

            resolver.Setup(x => x.GetHandlersOf(It.IsAny <Type>())).Returns(new[] { new SomeEventHandler() });
            var subscriber = EventStreamSubscriber.Create(new EventStreamSubscriberSettingsBuilder(connection, resolver.Object, new MemoryBackedStreamPositionRepositoryForDebugging()));

            await connection.AppendToStreamAsync("abc", new SomeEvent());

            await connection.AppendToStreamAsync("abc", new SomeEvent());

            await connection.AppendToStreamAsync("abc", new SomeEvent());

            subscriber.SubscribeTo("abc");

            await Task.Delay(TimeSpan.FromDays(1));
        }
Beispiel #7
0
 public void Setup()
 {
     _httpClientProxyMock       = new Mock <IHttpClientProxy>();
     _defaultConnectionSettings = GetConnectionSettings();
     _connection = EventStoreHttpConnection.Create(_defaultConnectionSettings, Endpoint);
 }
 public void Setup()
 {
     Connection = EventStoreHttpConnection.Create(ConnectionSettings.Default, "http://10.212.101.125:1113");
     //Connection = EventStoreHttpConnection.Create(ConnectionSettings.Default, "http://127.0.0.1:1113");
 }
 public Runner(Options options)
 {
     connection   = EventStoreHttpConnection.Create(options.Endpoint);
     this.options = options;
 }
 public void Setup()
 {
     _httpClientProxyMock = new Mock<IHttpClientProxy>();
     _defaultConnectionSettings = GetConnectionSettings();
     _connection = EventStoreHttpConnection.Create(_defaultConnectionSettings, Endpoint);
 }
 //[SetUp]
 public void Setup()
 {
     _connection = EventStoreHttpConnection.Create(ConnectionSettings.Default, "http://127.0.0.1:2113");
 }