public void ImportOnly() { string text = "import"; ExpressionResult result = expressionFinder.FindExpression(text, text.Length); Assert.AreEqual("import", result.Expression); }
protected override ExpressionResult GetExpressionResult() { string code = GetPythonScript(); PythonExpressionFinder finder = new PythonExpressionFinder(); return(finder.FindExpression(code, code.Length)); }
public void Init() { string text = " "; PythonExpressionFinder expressionFinder = new PythonExpressionFinder(); result = expressionFinder.FindExpression(text, 1); }
public void Init() { string code = "from System import "; int offset = 19; PythonExpressionFinder expressionFinder = new PythonExpressionFinder(); expressionResult = expressionFinder.FindExpression(code, offset); }
public void Init() { string text = "import\r\n"; PythonExpressionFinder expressionFinder = new PythonExpressionFinder(); int offset = 8; // Cursor is just after \r\n on second line. result = expressionFinder.FindExpression(text, offset); }
public void SetUpFixture() { resolver = new PythonResolver(); mockProjectContent = new MockProjectContent(); DefaultCompilationUnit cu = new DefaultCompilationUnit(mockProjectContent); cu.FileName = @"C:\Projects\Test\test.py"; ParseInformation parseInfo = new ParseInformation(cu); string python = "from System"; PythonExpressionFinder finder = new PythonExpressionFinder(); ExpressionResult expressionResult = finder.FindExpression(python, python.Length); resolveResult = resolver.Resolve(expressionResult, parseInfo, python) as PythonImportModuleResolveResult; }
public void NullTextExpression() { ExpressionResult result = expressionFinder.FindExpression(null, 10); Assert.IsNull(result.Expression); }