Inheritance: IEventStoreConnection
        public void SetUp()
        {
            _connection            = new FakeEventStoreConnection();
            _raisedEvents          = new List <ResolvedEvent>();
            _dropEvent             = new TaskCompletionSource <bool>(TaskCreationOptions.RunContinuationsAsynchronously);
            _raisedEventEvent      = new TaskCompletionSource <bool>(TaskCreationOptions.RunContinuationsAsynchronously);
            _liveProcessingStarted = false;
            _isDropped             = false;
            _dropReason            = SubscriptionDropReason.Unknown;
            _dropException         = null;

            var settings = new CatchUpSubscriptionSettings(1, 1, false, false, String.Empty);

            _subscription = new EventStoreStreamCatchUpSubscription(_connection, new NoopLogger(), StreamId, null, null,
                                                                    (subscription, ev) => {
                _raisedEvents.Add(ev);
                if (_raisedEvents.Count >= 2)
                {
                    _raisedEventEvent.TrySetResult(true);
                }
                return(Task.CompletedTask);
            },
                                                                    subscription => { _liveProcessingStarted = true; },
                                                                    (subscription, reason, ex) => {
                _isDropped     = true;
                _dropReason    = reason;
                _dropException = ex;
                _dropEvent.TrySetResult(true);
            },
                                                                    settings);
        }
示例#2
0
        public void SetUp()
        {
            _connection            = new FakeEventStoreConnection();
            _raisedEvents          = new List <ResolvedEvent>();
            _dropEvent             = new ManualResetEventSlim();
            _raisedEventEvent      = new ManualResetEventSlim();
            _liveProcessingStarted = false;
            _isDropped             = false;
            _dropReason            = SubscriptionDropReason.Unknown;
            _dropException         = null;

            var settings = new CatchUpSubscriptionSettings(1, 1, false, false, String.Empty);

            _subscription = new EventStoreStreamCatchUpSubscription(_connection, new NoopLogger(), StreamId, null, null,
                                                                    (subscription, ev) =>
            {
                _raisedEvents.Add(ev);
                _raisedEventEvent.Set();
                return(Task.CompletedTask);
            },
                                                                    subscription =>
            {
                _liveProcessingStarted = true;
            },
                                                                    (subscription, reason, ex) =>
            {
                _isDropped     = true;
                _dropReason    = reason;
                _dropException = ex;
                _dropEvent.Set();
            },
                                                                    settings);
        }
        public void SetUp()
        {
            _connection = new FakeEventStoreConnection();
            _raisedEvents = new List<ResolvedEvent>();
            _dropEvent = new ManualResetEventSlim();
            _raisedEventEvent = new ManualResetEventSlim();
            _liveProcessingStarted = false;
            _isDropped = false;
            _dropReason = SubscriptionDropReason.Unknown;
            _dropException = null;

            var settings = new CatchUpSubscriptionSettings(1, 1, false, false);
            _subscription = new EventStoreStreamCatchUpSubscription(_connection, new NoopLogger(), StreamId, null, null,
                (subscription, ev) =>
                {
                    _raisedEvents.Add(ev);
                    _raisedEventEvent.Set();
                },
                subscription =>
                {
                    _liveProcessingStarted = true;
                },
                (subscription, reason, ex) =>
                {
                    _isDropped = true;
                    _dropReason = reason;
                    _dropException = ex;
                    _dropEvent.Set();
                },
                settings);
        }