public void GetButtonFlatAppearanceObject() { using (Button button = new Button()) { SimpleAssignmentExpression expression = RubyParserHelper.GetSimpleAssignmentExpression("@button1.FlatAppearance.BorderSize = 3"); RubyControlFieldExpression field = RubyControlFieldExpression.Create(expression.Left as AttributeAccess); Assert.AreEqual(button.FlatAppearance, field.GetObjectForMemberName(button)); } }
public void GetInvalidTwoLevelDeepButtonPropertyDescriptorForSelfReference() { using (Button button = new Button()) { SimpleAssignmentExpression expression = RubyParserHelper.GetSimpleAssignmentExpression("self.button1.InvalidProperty.BorderSize = 3"); RubyControlFieldExpression field = RubyControlFieldExpression.Create(expression.Left as AttributeAccess); Assert.IsNull(field.GetObjectForMemberName(button)); } }
public void GetButtonObject() { using (Button button = new Button()) { SimpleAssignmentExpression expression = RubyParserHelper.GetSimpleAssignmentExpression("@button1.Size = System::Drawing::Size.new(10, 10)"); RubyControlFieldExpression field = RubyControlFieldExpression.Create(expression.Left as AttributeAccess); Assert.AreEqual(button, field.GetObjectForMemberName(button)); } }