public void TestSingleLineTokenization(string text, TokenType expectedToken, Type expectedType) { var token = OBMMScriptHandler.TokenizeLine(text); Assert.Equal(expectedToken, token.Type); Assert.Equal(expectedType, token.GetType()); }
public void TestScriptTokenization(string scriptPath, int count) { var file = Path.Combine("files", "scripts", scriptPath); Assert.True(File.Exists(file)); var text = File.ReadAllText(file, Encoding.UTF8); var tokens = OBMMScriptHandler.TokenizeScript(text).ToList(); Assert.NotEmpty(tokens); Assert.Equal(count, tokens.Count); }