예제 #1
0
        public void TestBuiltInMethodSignatureCompletion()
        {
            var codeCompletionServices = new CodeCompletionServices(libraryServicesCore);

            string functionPrefix = "";
            string functionName = "Count";

            string code = "";
            var overloads = codeCompletionServices.GetFunctionSignatures(code, functionName, functionPrefix);

            // Expected 1 "AddWithValueContainer" method overloads
            Assert.AreEqual(1, overloads.Count());

            foreach (var overload in overloads)
            {
                Assert.AreEqual(functionName, overload.Text);
            }
            Assert.AreEqual("Count : int (array : [])", overloads.ElementAt(0).Stub);

        }
예제 #2
0
        public void TestMethodSignatureReturnTypeCompletion()
        {

            var codeCompletionServices = new CodeCompletionServices(libraryServicesCore);

            string functionPrefix = "a";
            string ffiTargetClass = "CodeCompletionClass";
            string functionName = "AddWithValueContainer";

            string code = string.Format("{0} : {1};", functionPrefix, ffiTargetClass);
            var overloads = codeCompletionServices.GetFunctionSignatures(code, functionName, functionPrefix);

            // Expected 1 "AddWithValueContainer" method overloads
            Assert.AreEqual(1, overloads.Count());

            foreach (var overload in overloads)
            {
                Assert.AreEqual(functionName, overload.Text);
            }
            var expected = "AddWithValueContainer : ValueContainer[] (valueContainer : ValueContainer)";
            Assert.AreEqual(expected, overloads.ElementAt(0).Stub);
        }
예제 #3
0
        public void TestCtorSignatureCompletion()
        {
            string ffiTargetClass = "CodeCompletionClass";
            string functionName = "CodeCompletionClass";

            var codeCompletionServices = new CodeCompletionServices(libraryServicesCore);

            string code = "";
            var overloads = codeCompletionServices.GetFunctionSignatures(code, functionName, ffiTargetClass);

            // Expected 3 "CodeCompletionClass" ctor overloads
            Assert.AreEqual(3, overloads.Count());

            foreach (var overload in overloads)
            {
                Assert.AreEqual(functionName, overload.Text);
            }
            Assert.AreEqual("CodeCompletionClass (i1 : int, i2 : int, i3 : int)", overloads.ElementAt(2).Stub);
        }
예제 #4
0
        public void TestMethodSignatureCompletion()
        {
            var codeCompletionServices = new CodeCompletionServices(libraryServicesCore);

            string functionPrefix = "a";
            string ffiTargetClass = "CodeCompletionClass";
            string functionName = "OverloadedAdd";

            string code = string.Format("{0} : {1};", functionPrefix, ffiTargetClass);
            var overloads = codeCompletionServices.GetFunctionSignatures(code, functionName, functionPrefix);

            // Expected 2 "OverloadedAdd" method overloads
            Assert.AreEqual(2, overloads.Count());

            foreach (var overload in overloads)
            {
                Assert.AreEqual(functionName, overload.Text);
            }
            Assert.AreEqual("OverloadedAdd : int (cf : ClassFunctionality)", overloads.ElementAt(0).Stub);
        }
예제 #5
0
        public void TestStaticMethodSignatureCompletion()
        {
            var codeCompletionServices = new CodeCompletionServices(libraryServicesCore);

            string ffiTargetClass = "CodeCompletionClass";
            string functionName = "StaticFunction";

            string code = "";
            var overloads = codeCompletionServices.GetFunctionSignatures(code, functionName, ffiTargetClass);

            // Expected 1 "StaticFunction" method overload
            Assert.AreEqual(1, overloads.Count());

            foreach (var overload in overloads)
            {
                Assert.AreEqual(functionName, overload.Text);
            }
            Assert.AreEqual("StaticFunction : int ()", overloads.ElementAt(0).Stub);
        }