コード例 #1
0
        public void GetCode_EndLineIsOneAndTwoLinesOfCode_ReturnsFirstLineOfCode()
        {
            string fullCode =
                "first\r\n" +
                "second";

            CreateLocalMethod(fullCode);

            int    endLine = 1;
            string code    = method.GetCode(endLine);

            string expectedCode = "first\r\n";

            Assert.AreEqual(expectedCode, code);
        }
コード例 #2
0
        string GetLocalMethodCode(PythonResolverContext resolverContext)
        {
            ScriptingLocalMethod localMethod = new ScriptingLocalMethod(resolverContext.FileContent);
            int beginLine = resolverContext.ExpressionRegion.BeginLine;

            return(localMethod.GetCode(beginLine));
        }