public void GetComparer_WithPropertyPathNull() { var column = new BocCustomColumnDefinition(); column.SetPropertyPath(null); column.CustomCell = MockRepository.GeneratePartialMock <BocCustomColumnDefinitionCell>(); var comparer = ((IBocSortableColumnDefinition)column).CreateCellValueComparer(); Assert.That(comparer, Is.InstanceOf <BusinessObjectPropertyPathBasedComparer>()); Assert.That(((BusinessObjectPropertyPathBasedComparer)comparer).PropertyPath, Is.InstanceOf <NullBusinessObjectPropertyPath>()); }
public override void SetUp() { base.SetUp(); _editModeHost = new FakeEditModeHost(); _editModeHost.ID = "BocList"; _editModeHost.RowIDProvider = new FakeRowIDProvider(); _editModeHost.EditModeControlFactory = EditableRowControlFactory.CreateEditableRowControlFactory(); _editModeHost.EditModeDataSourceFactory = new EditableRowDataSourceFactory(); _editableRow = new EditableRow(_editModeHost); _editableRow.ID = "Row"; NamingContainer.Controls.Add(_editableRow); _value01 = (IBusinessObject)TypeWithAllDataTypes.Create("A", 1); _typeWithAllDataTypesClass = BindableObjectProviderTestHelper.GetBindableObjectClass(typeof(TypeWithAllDataTypes)); _typeWithAllDataTypesStringValuePath = BusinessObjectPropertyPath.CreateStatic(_typeWithAllDataTypesClass, "String"); _typeWithAllDataTypesInt32ValuePath = BusinessObjectPropertyPath.CreateStatic(_typeWithAllDataTypesClass, "Int32"); _typeWithAllDataTypesStringValueSimpleColumn = new BocSimpleColumnDefinition(); _typeWithAllDataTypesStringValueSimpleColumn.SetPropertyPath(_typeWithAllDataTypesStringValuePath); _typeWithAllDataTypesStringValueSimpleColumnAsDynamic = new BocSimpleColumnDefinition(); _typeWithAllDataTypesStringValueSimpleColumnAsDynamic.SetPropertyPath(BusinessObjectPropertyPath.CreateDynamic("StringValue")); _typeWithAllDataTypesStringValueSimpleColumnAsDynamic.IsDynamic = true; _typeWithAllDataTypesInt32ValueSimpleColumn = new BocSimpleColumnDefinition(); _typeWithAllDataTypesInt32ValueSimpleColumn.SetPropertyPath(_typeWithAllDataTypesInt32ValuePath); _typeWithAllDataTypesStringValueFirstValueCompoundColumn = new BocCompoundColumnDefinition(); _typeWithAllDataTypesStringValueFirstValueCompoundColumn.PropertyPathBindings.Add( new PropertyPathBinding(_typeWithAllDataTypesStringValuePath)); _typeWithAllDataTypesStringValueFirstValueCompoundColumn.PropertyPathBindings.Add( new PropertyPathBinding(_typeWithAllDataTypesStringValuePath)); _typeWithAllDataTypesStringValueFirstValueCompoundColumn.FormatString = "{0}, {1}"; _typeWithAllDataTypesStringValueCustomColumn = new BocCustomColumnDefinition(); _typeWithAllDataTypesStringValueCustomColumn.SetPropertyPath(_typeWithAllDataTypesStringValuePath); _typeWithAllDataTypesStringValueCustomColumn.IsSortable = true; _commandColumn = new BocCommandColumnDefinition(); _rowEditModeColumn = new BocRowEditModeColumnDefinition(); _dropDownMenuColumn = new BocDropDownMenuColumnDefinition(); }