Ejemplo n.º 1
0
        public void NoBaseClass()
        {
            string code = "class MainForm:\r\n" +
                          "    def InitializeComponent(self):\r\n" +
                          "        pass\r\n";

            ClassDefinition classDef = GetClassDefinition(code);

            Assert.AreEqual(String.Empty, PythonComponentWalker.GetBaseClassName(classDef));
        }
Ejemplo n.º 2
0
        public void UnqualifiedBaseClass()
        {
            string code = "class MainForm(Form):\r\n" +
                          "    def InitializeComponent(self):\r\n" +
                          "        self.SuspendLayout()\r\n" +
                          "        # \r\n" +
                          "        # MainForm\r\n" +
                          "        # \r\n" +
                          "        self.ClientSize = System.Drawing.Size(300, 400)\r\n" +
                          "        self.Name = \"MainForm\"\r\n" +
                          "        self.ResumeLayout(False)\r\n";

            ClassDefinition classDef = GetClassDefinition(code);

            Assert.AreEqual("Form", PythonComponentWalker.GetBaseClassName(classDef));
        }