public void NumberParser() { var tokenizer = new EclTokenizer(); var parsed = EclParser.Number.Parse(tokenizer.Tokenize("123")); Assert.Equal(123, parsed); }
public void AllTokenKinds() { var sut = new EclTokenizer(); var str = "UP DOWN@\n,()123"; var tryTokenize = sut.TryTokenize(str); Assert.Null(tryTokenize.ErrorMessage); }
public void DownKeyword() { var tokenizer = new EclTokenizer(); var parsed = EclParser.Command.Parse(tokenizer.Tokenize("(DOWN 123)")); var elevatorCommand = new ElevatorCommand() { Distance = new Distance() { IsRelative = false, Value = -123 }, }; Assert.Equal(elevatorCommand, parsed); }
public void List() { var tokenizer = new EclTokenizer(); var parsed = EclParser.Parse("(UP 100),(DOWN 200),(DOWN 100),(DOWN @1),(UP @3),(WAIT)(UP 300)"); }