Add() public method

Add a Sequence into this aggregate. This should only be used during initialisation. Use SequenceGroup.AddWhileRunning.
public Add ( ISequence sequence ) : void
sequence ISequence sequence to be added to the aggregate.
return void
 public void ShouldNotFailIfTryingToRemoveNotExistingSequence()
 {
     var group = new SequenceGroup();
     group.Add(new Sequence());
     group.Add(new Sequence());
     group.remove(new Sequence());
 }
        public void ShouldReportSizeOfGroup()
        {
            var sequenceGroup = new SequenceGroup();
            sequenceGroup.Add(new Sequence());
            sequenceGroup.Add(new Sequence());
            sequenceGroup.Add(new Sequence());

            Assert.AreEqual(3, sequenceGroup.Size);
        }
        public void ShouldReportTheMinimumSequenceForGroupOfTwo()
        {
            var sequenceThree = new Sequence(3L);
            var sequenceSeven = new Sequence(7L);
            var sequenceGroup = new SequenceGroup();
            sequenceGroup.Add(sequenceSeven);
            sequenceGroup.Add(sequenceThree);

            Assert.AreEqual(sequenceThree.Value, sequenceGroup.Value);
        }
        public void ShouldRemoveSequenceFromGroup()
        {
            var sequenceThree = new Sequence(3L);
            var sequenceSeven = new Sequence(7L);
            var sequenceGroup = new SequenceGroup();
            sequenceGroup.Add(sequenceSeven);
            sequenceGroup.Add(sequenceThree);

            Assert.AreEqual(sequenceThree.Value, sequenceGroup.Value);
            Assert.True(sequenceGroup.remove(sequenceThree));
            Assert.AreEqual(sequenceSeven.Value, sequenceGroup.Value);
            Assert.AreEqual(1, sequenceGroup.Size);
        }
        public void ShouldAddOneSequenceToGroup()
        {
            var sequence = new Sequence(7L);
            var sequenceGroup = new SequenceGroup();
            sequenceGroup.Add(sequence);

            Assert.AreEqual(sequence.Value, sequenceGroup.Value);
        }
        public void ShouldSetGroupSequenceToSameValue()
        {
            var sequenceThree = new Sequence(3L);
            var sequenceSeven = new Sequence(7L);
            var sequenceGroup = new SequenceGroup();
            sequenceGroup.Add(sequenceSeven);
            sequenceGroup.Add(sequenceThree);
            var expectedSequence = 11L;
            sequenceGroup.Value = expectedSequence;

            Assert.AreEqual(expectedSequence, sequenceThree.Value);
            Assert.AreEqual(expectedSequence, sequenceSeven.Value);
        }
        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 (int i = 0; i < 11; i++)
            {
                ringBuffer.Publish(ringBuffer.Next());
            }

            sequenceGroup.AddWhileRunning(ringBuffer, sequenceThree);
            Assert.AreEqual(sequenceThree.Value,10L);
        }