コード例 #1
0
        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);
        }
コード例 #2
0
        public void CanIdentifyVariableTypeAndGetCompletionData()
        {
            var str = "a = 5.0\na.";

            var completionProvider = new IronPythonCompletionProvider();
            var completionData = completionProvider.GetCompletionData(str);

            Assert.AreNotEqual(0, completionData.Length);

        }
コード例 #3
0
        public void CanImportSystemCollectionsLibraryAndGetCompletionData()
        {
            var str = "\nimport System.Collections\nSystem.Collections.";
            var completionProvider = new IronPythonCompletionProvider();

            var completionData = completionProvider.GetCompletionData(str);

            Assert.AreEqual(29, completionData.Length);
        }
コード例 #4
0
        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"));

        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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"));

        }