public void NoLeftHandSideExpressionsInAssignment() { List<Expression> lhs = new List<Expression>(); AssignmentStatement assign = new AssignmentStatement(lhs.ToArray(), null); PythonComponentWalker walker = new PythonComponentWalker(this); walker.Walk(assign); }
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); } }
public void SetUpFixture() { PythonComponentWalker walker = new PythonComponentWalker(componentCreator); userControl = walker.CreateComponent(PythonCode) as UserControl; }
public void PythonFormWalkerExceptionThrown() { PythonComponentWalker walker = new PythonComponentWalker(this); walker.CreateComponent(pythonCode); Assert.Fail("Exception should have been thrown before this."); }
public void SetUpFixture() { PythonComponentWalker walker = new PythonComponentWalker(componentCreator); form = walker.CreateComponent(PythonCode) as Form; userControl = form.Controls[0] as DoublePropertyUserControl; }