public void ShouldAddWhileRunning() { var ringBuffer = RingBuffer<TestEvent>.CreateSingleProducer(()=>new TestEvent(), 32); var sequenceThree = new Sequence(3L); var sequenceSeven = new Sequence(7L); var sequenceGroup = new SequenceGroup(); sequenceGroup.Add(sequenceSeven); for (var i = 0; i < 11; i++) { ringBuffer.Publish(ringBuffer.Next()); } sequenceGroup.AddWhileRunning(ringBuffer, sequenceThree); Assert.That(sequenceThree.Value, Is.EqualTo(10L)); }
public void ShouldAddWhileRunning() { var ringBuffer = RingBuffer <TestEvent> .CreateSingleProducer(() => new TestEvent(), 32); var sequenceThree = new Sequence(3L); var sequenceSeven = new Sequence(7L); var sequenceGroup = new SequenceGroup(); sequenceGroup.Add(sequenceSeven); for (var i = 0; i < 11; i++) { ringBuffer.Publish(ringBuffer.Next()); } sequenceGroup.AddWhileRunning(ringBuffer, sequenceThree); Assert.That(sequenceThree.Value, Is.EqualTo(10L)); }
public void ShouldAddWhileRunning() { var ringBuffer = RingBuffer <TestEvent> .CreateSingleProducer(new TestEventFactory(), 32); var sequenceThree = new Sequence(3L); var sequenceSeven = new Sequence(7L); var sequenceGroup = new SequenceGroup(); sequenceGroup.Add(sequenceSeven); for (int i = 0; i < 11; i++) { ringBuffer.Publish(ringBuffer.Next()); } sequenceGroup.AddWhileRunning(ringBuffer, sequenceThree); Assert.Equal(10L, sequenceThree.GetValue()); }