public void SetUpFixture() { RubyComponentWalker walker = new RubyComponentWalker(componentCreator); form = walker.CreateComponent(RubyCode) as Form; userControl = form.Controls[0] as DoublePropertyUserControl; }
public void RubyFormWalkerExceptionThrown() { RubyComponentWalker walker = new RubyComponentWalker(this); walker.CreateComponent(RubyCode); Assert.Fail("Exception should have been thrown before this."); }
public void SetUpFixture() { BeforeSetUpFixture(); RubyComponentWalker walker = new RubyComponentWalker(componentCreator); form = walker.CreateComponent(RubyCode) as Form; }
public void NoBaseClass() { string code = "class MainForm\r\n" + " def InitializeComponent()\r\n" + " end\r\n" + "end"; ClassDefinition classDef = GetClassDefinition(code); Assert.AreEqual(String.Empty, RubyComponentWalker.GetBaseClassName(classDef)); }
public void UnqualifiedBaseClass() { string code = "class MainForm < Form\r\n" + " def InitializeComponent()\r\n" + " self.SuspendLayout()\r\n" + " # \r\n" + " # MainForm\r\n" + " # \r\n" + " self.ClientSize = System::Drawing::Size.new(300, 400)\r\n" + " self.Name = \"MainForm\"\r\n" + " self.ResumeLayout(false)\r\n" + " end\r\n" + "end"; ClassDefinition classDef = GetClassDefinition(code); Assert.AreEqual("Form", RubyComponentWalker.GetBaseClassName(classDef)); }
public void SelfAssignmentWithUnknownTypeRhs() { string RubyCode = "require \"System.Windows.Forms\"\r\n" + "\r\n" + "class MainForm < System::Windows::Forms::Form\r\n" + " def initialize()\r\n" + " self.InitializeComponent()\r\n" + " end\r\n "+ "\r\n" + " def InitializeComponent()\r\n" + " self.ClientSize = Unknown::Type(10)\r\n" + " end\r\n" + "end"; try { RubyComponentWalker walker = new RubyComponentWalker(new MockComponentCreator()); walker.CreateComponent(RubyCode); Assert.Fail("Exception should have been thrown before this."); } catch (RubyComponentWalkerException ex) { string expectedMessage = String.Format(StringParser.Parse("${res:ICSharpCode.PythonBinding.UnknownTypeName}"), "Unknown.Type"); Assert.AreEqual(expectedMessage, ex.Message); } }
public void SetUpFixture() { RubyComponentWalker walker = new RubyComponentWalker(componentCreator); userControl = walker.CreateComponent(RubyCode) as UserControl; }