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); }
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()); }
private void ReadFullExpression(SequenceProcessor sequenceProcessor) { while (sequenceProcessor.ReadNextSequence().Length > 0) { } }