Exemplo n.º 1
0
        public void Reset_CallReset_StateReset()
        {
            var sequenceProcessor = new SequenceProcessor("(123456");

            sequenceProcessor.ReadNextSequence();
            sequenceProcessor.ReadNextSequence();

            sequenceProcessor.Reset();

            Assert.True(sequenceProcessor.BracketsValid);
            Assert.Equal(0, sequenceProcessor.CurrentIndex);
        }
Exemplo n.º 2
0
        public void ReadNextSequence_ValidInput_String()
        {
            var sequenceProcessor = new SequenceProcessor("   123   + b +(  44");

            Assert.Equal("123", sequenceProcessor.ReadNextSequence());
            Assert.Equal("+", sequenceProcessor.ReadNextSequence());
            Assert.Equal("b", sequenceProcessor.ReadNextSequence());
            Assert.Equal("+", sequenceProcessor.ReadNextSequence());
            Assert.Equal("(", sequenceProcessor.ReadNextSequence());
            Assert.Equal("44", sequenceProcessor.ReadNextSequence());
        }
Exemplo n.º 3
0
 private void ReadFullExpression(SequenceProcessor sequenceProcessor)
 {
     while (sequenceProcessor.ReadNextSequence().Length > 0)
     {
     }
 }