public void GetObjectForUnknownComponent() { string pythonCode = "self._menuStrip1.SuspendLayout()"; CallExpression callExpression = PythonParserHelper.GetCallExpression(pythonCode); PythonControlFieldExpression field = PythonControlFieldExpression.Create(callExpression); using (MenuStrip menuStrip = new MenuStrip()) { MockComponentCreator creator = new MockComponentCreator(); creator.Add(menuStrip, "unknown"); Assert.IsNull(field.GetMember(creator)); } }
public void GetObjectForUnknownComponent() { string RubyCode = "@menuStrip1.SuspendLayout()"; MethodCall call = RubyParserHelper.GetMethodCall(RubyCode); RubyControlFieldExpression field = RubyControlFieldExpression.Create(call); using (MenuStrip menuStrip = new MenuStrip()) { MockComponentCreator creator = new MockComponentCreator(); creator.Add(menuStrip, "unknown"); Assert.IsNull(field.GetMember(creator)); } }
public void GetObjectInMethodCall() { string pythonCode = "self._menuStrip1.Items.AddRange(System.Array[System.Windows.Forms.ToolStripItem](\r\n" + " [self._fileToolStripMenuItem,\r\n" + " self._editToolStripMenuItem]))"; CallExpression callExpression = PythonParserHelper.GetCallExpression(pythonCode); PythonControlFieldExpression field = PythonControlFieldExpression.Create(callExpression); using (MenuStrip menuStrip = new MenuStrip()) { MockComponentCreator creator = new MockComponentCreator(); creator.Add(menuStrip, "menuStrip1"); Assert.AreSame(menuStrip.Items, field.GetMember(creator)); } }
public void GetObjectInMethodCall() { string RubyCode = "@menuStrip1.Items.AddRange(System::Array[System::Windows::Forms::ToolStripItem].new(\r\n" + " [@fileToolStripMenuItem,\r\n" + " @editToolStripMenuItem]))"; MethodCall call = RubyParserHelper.GetMethodCall(RubyCode); RubyControlFieldExpression field = RubyControlFieldExpression.Create(call); using (MenuStrip menuStrip = new MenuStrip()) { MockComponentCreator creator = new MockComponentCreator(); creator.Add(menuStrip, "menuStrip1"); Assert.AreSame(menuStrip.Items, field.GetMember(creator)); } }