示例#1
0
        private static void MemberCompletionTest(int location, string sourceCode, string expectedExpression)
        {
            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.GetCompletions(snapshot, buffer, new MockTrackingSpan(snapshot, location, 1));

            AreEqual(context.Text, expectedExpression);
        }
示例#2
0
        private static void MemberCompletionTest(int location, string sourceCode, string expectedExpression)
        {
            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.GetCompletions(snapshot, buffer, new MockTrackingSpan(snapshot, location, 1));
            AreEqual(context.Text, expectedExpression);
        }