public void StringAssignmentShouldNotResolve() { string code = "a = \"test\""; PythonVariableResolver resolver = new PythonVariableResolver(); Assert.AreEqual(null, resolver.Resolve("a", @"C:\Projects\Test\Test.py", code)); }
public void GetTypeOfInstance() { string code = "a = Class1()"; PythonVariableResolver resolver = new PythonVariableResolver(); Assert.AreEqual("Class1", resolver.Resolve("a", @"C:\Projects\Test\Test.py", code)); }
public void GetTypeOfInstanceWithTwoNamespaces() { string code = "a = Root.Test.Class1()"; PythonVariableResolver resolver = new PythonVariableResolver(); Assert.AreEqual("Root.Test.Class1", resolver.Resolve("a", @"C:\Projects\Test\Test.py", code)); }
public void DifferentTypeCreatedLast() { string code = "a = Class1()\r\n" + "b = Class2()"; PythonVariableResolver resolver = new PythonVariableResolver(); Assert.AreEqual("Class1", resolver.Resolve("a", @"C:\Projects\Test\Test.py", code)); }
public void NullCodeShouldNotResolve() { PythonVariableResolver resolver = new PythonVariableResolver(); Assert.AreEqual(null, resolver.Resolve("a", @"C:\Projects\Test\Test.py", null)); }