public void CanGetCompletionDataForArrayListVariable() { var str = "from System.Collections import ArrayList\na = ArrayList()\na."; var completionProvider = new IronPythonCompletionProvider(); var matches = completionProvider.GetCompletionData(str); Assert.AreNotEqual(0, matches.Length); //Assert.AreEqual(typeof(IronPython.Runtime.PythonDictionary), matches["a"].Item3); }
public void CanIdentifyVariableTypeAndGetCompletionData() { var str = "a = 5.0\na."; var completionProvider = new IronPythonCompletionProvider(); var completionData = completionProvider.GetCompletionData(str); Assert.AreNotEqual(0, completionData.Length); }
public void CanImportSystemCollectionsLibraryAndGetCompletionData() { var str = "\nimport System.Collections\nSystem.Collections."; var completionProvider = new IronPythonCompletionProvider(); var completionData = completionProvider.GetCompletionData(str); Assert.AreEqual(29, completionData.Length); }
public void CanImportSystemLibraryAndGetCompletionData() { var str = "\nimport System\nSystem."; var completionProvider = new IronPythonCompletionProvider(); var completionData = completionProvider.GetCompletionData(str); Assert.AreEqual(224, completionData.Length); Assert.AreEqual(1, completionProvider.ImportedTypes.Count); Assert.IsTrue(completionProvider.ImportedTypes.ContainsKey("System")); }
public void CanImportSystemCollectionsLibraryAndGetCompletionData() { var str = "\nimport System.Collections\nSystem.Collections."; var completionProvider = new IronPythonCompletionProvider(); var completionData = completionProvider.GetCompletionData(str); var completionList = completionData.Select(d => d.Text); Assert.IsTrue(completionList.Any()); Assert.IsTrue(completionList.Intersect(new[] { "Hashtable", "Queue", "Stack"}).Count() == 3); Assert.AreEqual(29, completionData.Length); }
public void CanImportSystemLibraryAndGetCompletionData() { var str = "\nimport System\nSystem."; var completionProvider = new IronPythonCompletionProvider(); var completionData = completionProvider.GetCompletionData(str); // Randomly verify some namepsaces are in the completion list var completionList = completionData.Select(d => d.Text); Assert.IsTrue(completionList.Any()); Assert.IsTrue(completionList.Intersect(new[] { "IO", "Console", "Reflection" }).Count() == 3); Assert.AreEqual(1, completionProvider.ImportedTypes.Count); Assert.IsTrue(completionProvider.ImportedTypes.ContainsKey("System")); }