Esempio n. 1
0
        public TestStream <T> AddStreamProbe <T>(Guid streamId, string streamNamespace)
        {
            var id = new TestStreamId(streamId, streamNamespace);

            var stream = new TestStream <T>(streamId, streamNamespace, Name);

            _streams.Add(id, stream);

            return(stream);
        }
        public TestStreamSubscriptionHandle(
            Guid streamId,
            string streamNamespace,
            string providerName,
            Action <IAsyncObserver <T> > unsubscribe,
            Action <IAsyncObserver <T> > onAttachingObserver = null,
            Action <IAsyncObserver <T> > onDetachingObserver = null)
        {
            _unsubscribe         = unsubscribe ?? throw new ArgumentNullException(nameof(unsubscribe));
            _onAttachingObserver = onAttachingObserver;
            _onDetachingObserver = onDetachingObserver;

            _handleId       = Guid.NewGuid();
            _streamIdentity = new TestStreamId(streamId, streamNamespace);
            _providerName   = providerName;
        }