示例#1
0
 private void CheckStringProperty(IBusinessObjectStringProperty expectedProperty, IBusinessObjectProperty actualProperty)
 {
     Assert.That(
         expectedProperty.MaxLength,
         Is.EqualTo(((IBusinessObjectStringProperty)actualProperty).MaxLength),
         "MaxLength");
 }
示例#2
0
 public void SetUp()
 {
     _stringFormatterService = new BusinessObjectStringFormatterService();
     _mockRepository         = new MockRepository();
     _mockBusinessObject     = _mockRepository.StrictMock <IBusinessObject> ();
     _mockProperty           = _mockRepository.StrictMock <IBusinessObjectStringProperty> ();
 }
示例#3
0
        public override void SetUp()
        {
            base.SetUp();
            _bocTextValue    = new BocTextValueMock();
            _bocTextValue.ID = "BocTextValue";
            NamingContainer.Controls.Add(_bocTextValue);

            _businessObject = TypeWithString.Create();

            _propertyStringValue =
                (IBusinessObjectStringProperty)((IBusinessObject)_businessObject).BusinessObjectClass.GetPropertyDefinition("StringValue");

            _dataSource = new StubDataSource(((IBusinessObject)_businessObject).BusinessObjectClass);
            _dataSource.BusinessObject = (IBusinessObject)_businessObject;
        }
示例#4
0
        /// <summary>
        ///   Refreshes all properties of <see cref="BocTextValue"/> that depend on the current value of
        ///   <see cref="BusinessObjectBoundWebControl.Property"/>.
        /// </summary>
        private void RefreshPropertiesFromObjectModel()
        {
            if (Property != null)
            {
                if (_valueType == BocTextValueType.Undefined)
                {
                    _actualValueType = GetBocTextValueType(Property);
                }

                IBusinessObjectStringProperty stringProperty = Property as IBusinessObjectStringProperty;
                if (stringProperty != null)
                {
                    if (TextBoxStyle.MaxLength == null)
                    {
                        int?length = stringProperty.MaxLength;
                        if (length.HasValue)
                        {
                            TextBoxStyle.MaxLength = length.Value;
                        }
                    }
                }
            }
        }