コード例 #1
0
        public void NewMethodDefinition()
        {
            textEditor.Text = "def newMethod:\r\n" +
                              "";
            int    indentResult = formattingStrategy.IndentLine(textEditor.ActiveTextAreaControl.TextArea, 1);
            string expectedText = "def newMethod:\r\n" +
                                  "\t";

            Assert.AreEqual(expectedText, textEditor.Text);
            Assert.AreEqual(1, indentResult);
        }
コード例 #2
0
        public void IndentLine_IndentLineAfterNewMethodDefinition_LineIsIndentedByOneTab()
        {
            CreatePythonFormattingStrategy();

            textEditor.Text =
                "def newMethod:\r\n" +
                "";

            IDocumentLine line = textEditorAdapter.Document.GetLine(2);

            formattingStrategy.IndentLine(textEditorAdapter, line);
            string text = textEditor.Text;

            string expectedText =
                "def newMethod:\r\n" +
                "\t";

            Assert.AreEqual(expectedText, text);
        }