Пример #1
0
        public void SetUpFixture()
        {
            BeforeSetUpFixture();
            PythonComponentWalker walker = new PythonComponentWalker(componentCreator);

            form = walker.CreateComponent(PythonCode) as Form;
        }
Пример #2
0
        public void PythonFormWalkerExceptionThrown()
        {
            PythonComponentWalker walker = new PythonComponentWalker(this);

            walker.CreateComponent(pythonCode);
            Assert.Fail("Exception should have been thrown before this.");
        }
Пример #3
0
        public void SetUpFixture()
        {
            PythonComponentWalker walker = new PythonComponentWalker(componentCreator);

            form        = walker.CreateComponent(PythonCode) as Form;
            userControl = form.Controls[0] as DoublePropertyUserControl;
        }
        public void LocalVariableAssignmentWithUnknownTypeRhs()
        {
            string pythonCode = "from System.Windows.Forms import Form\r\n" +
                                "\r\n" +
                                "class MainForm(System.Windows.Forms.Form):\r\n" +
                                "    def __init__(self):\r\n" +
                                "        self.InitializeComponent()\r\n" +
                                "\r\n" +
                                "    def InitializeComponent(self):\r\n" +
                                "        abc = Unknown.Type(10)\r\n";

            try {
                PythonComponentWalker walker = new PythonComponentWalker(new MockComponentCreator());
                walker.CreateComponent(pythonCode);
                Assert.Fail("Exception should have been thrown before this.");
            } catch (PythonComponentWalkerException ex) {
                string expectedMessage = String.Format(StringParser.Parse("${res:ICSharpCode.PythonBinding.UnknownTypeName}"), "Unknown.Type");
                Assert.AreEqual(expectedMessage, ex.Message);
            }
        }
Пример #5
0
        public void SetUpFixture()
        {
            PythonComponentWalker walker = new PythonComponentWalker(componentCreator);

            userControl = walker.CreateComponent(PythonCode) as UserControl;
        }