public void When_event_source_is_blocked_event_is_enqueued()
        {
            Guid eventSourceId = Guid.NewGuid();

            int enqueuedToProcessingCount = 0;

            var sut = new Demultiplexer();
            sut.EventDemultiplexed += (s, e) => { enqueuedToProcessingCount++; };
            sut.Demultiplex(CreateElement(eventSourceId));
            sut.Demultiplex(CreateElement(eventSourceId));

            enqueuedToProcessingCount.Should().Be(1);
        }
Beispiel #2
0
        public void When_event_source_is_blocked_event_is_enqueued()
        {
            Guid eventSourceId = Guid.NewGuid();

            int enqueuedToProcessingCount = 0;

            var sut = new Demultiplexer();

            sut.EventDemultiplexed += (s, e) => { enqueuedToProcessingCount++; };
            sut.Demultiplex(CreateEvent(eventSourceId));
            sut.Demultiplex(CreateEvent(eventSourceId));

            enqueuedToProcessingCount.Should().Be(1);
        }
        public void Different_event_sources_does_not_block_each_other()
        {
            Guid firstEventSourceId = Guid.NewGuid();
            Guid secondEventSourceId = Guid.NewGuid();

            int enqueuedToProcessingCount = 0;

            var sut = new Demultiplexer();
            sut.EventDemultiplexed += (s, e) => { enqueuedToProcessingCount++; };
            sut.Demultiplex(CreateElement(firstEventSourceId));
            sut.Demultiplex(CreateElement(secondEventSourceId));

            enqueuedToProcessingCount.Should().Be(2);
        }
Beispiel #4
0
        public void Different_event_sources_does_not_block_each_other()
        {
            Guid firstEventSourceId  = Guid.NewGuid();
            Guid secondEventSourceId = Guid.NewGuid();

            int enqueuedToProcessingCount = 0;

            var sut = new Demultiplexer();

            sut.EventDemultiplexed += (s, e) => { enqueuedToProcessingCount++; };
            sut.Demultiplex(CreateEvent(firstEventSourceId));
            sut.Demultiplex(CreateEvent(secondEventSourceId));

            enqueuedToProcessingCount.Should().Be(2);
        }