Пример #1
0
        private static void SignatureTest(int location, string sourceCode, string expectedExpression, int paramIndex)
        {
            if (location < 0)
            {
                location = sourceCode.Length + location;
            }

            var analyzer = new PythonAnalyzer(new MockDlrRuntimeHost(), new MockErrorProviderFactory());
            var buffer   = new MockTextBuffer(sourceCode);
            var snapshot = (MockTextSnapshot)buffer.CurrentSnapshot;
            var context  = analyzer.GetSignatures(snapshot, buffer, new MockTrackingSpan(snapshot, location, 1));

            AreEqual(context.Text, expectedExpression);
            AreEqual(context.ParameterIndex, paramIndex);
        }
Пример #2
0
        private static void SignatureTest(int location, string sourceCode, string expectedExpression, int paramIndex)
        {
            if (location < 0) {
                location = sourceCode.Length + location;
            }

            var analyzer = new PythonAnalyzer(new MockDlrRuntimeHost(), new MockErrorProviderFactory());
            var buffer = new MockTextBuffer(sourceCode);
            var snapshot = (MockTextSnapshot)buffer.CurrentSnapshot;
            var context = analyzer.GetSignatures(snapshot, buffer, new MockTrackingSpan(snapshot, location, 1));
            AreEqual(context.Text, expectedExpression);
            AreEqual(context.ParameterIndex, paramIndex);
        }