public void Should_return_empty_row_if_data_source_is_emmpty() { enumerator = new GridDataSourceEnumerator(new object[0], factory.Object); var first = enumerator.First(); first.Type.ShouldEqual(GridItemType.EmptyRow); first.DataItem.ShouldBeNull(); }
public void Should_return_empty_row_if_data_source_is_null() { enumerator = new GridDataSourceEnumerator(null, factory.Object, default(GridInsertRowPosition)); var first = enumerator.First(); first.Type.ShouldEqual(GridItemType.EmptyRow); first.DataItem.ShouldBeNull(); }
public void Should_return_group_rows() { var dataSource = ArrangeGroupedDataSource(); enumerator = new GridDataSourceEnumerator(dataSource, factory.Object); var first = enumerator.First(); first.Type.ShouldEqual(GridItemType.GroupRow); var group = first.DataItem as IGroup; group.Key.ShouldEqual(Gender.Female); }
public void Should_return_data_rows() { var data = new[] { "foo" }; var item = new GridItem { Type = GridItemType.DataRow, DataItem = data[0] }; factory.Setup(f => f.CreateItem(data[0])).Returns(() => item); enumerator = new GridDataSourceEnumerator(data, factory.Object); var first = enumerator.First(); first.ShouldBeSameAs(item); }
public void Should_return_data_rows() { var data = new[] { "foo" }; var item = new GridItem { Type = GridItemType.DataRow, DataItem = data[0] }; factory.Setup(f => f.CreateItem(data[0])).Returns(() => item); enumerator = new GridDataSourceEnumerator(data, factory.Object, default(GridInsertRowPosition)); var first = enumerator.First(); first.ShouldBeSameAs(item); }
public void Should_return_group_rows() { var dataSource = ArrangeGroupedDataSource(); enumerator = new GridDataSourceEnumerator(dataSource, factory.Object, default(GridInsertRowPosition)); var first = enumerator.First(); first.Type.ShouldEqual(GridItemType.GroupRow); var group = first.DataItem as IGroup; group.Key.ShouldEqual(Gender.Female); }