private void CheckStringProperty(IBusinessObjectStringProperty expectedProperty, IBusinessObjectProperty actualProperty) { Assert.That( expectedProperty.MaxLength, Is.EqualTo(((IBusinessObjectStringProperty)actualProperty).MaxLength), "MaxLength"); }
public void SetUp() { _stringFormatterService = new BusinessObjectStringFormatterService(); _mockRepository = new MockRepository(); _mockBusinessObject = _mockRepository.StrictMock <IBusinessObject> (); _mockProperty = _mockRepository.StrictMock <IBusinessObjectStringProperty> (); }
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; }
/// <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; } } } } }