public void should_use_field_count_from_FieldCollection() {
            var data = new CollectionDataReader<Row>(SomeRows);
                data.ColumnMappings
                    .Add(x => (object)x.Id)
                    .Add(x => x.Value);

            Check.That(() => (data as IDataReader).FieldCount == 2);
        }
        public void contiains_source_number_of_rows() {
            IDataReader data = new CollectionDataReader<Row>(SomeRows);

            var count = 0;
            while(data.Read())
                ++count;

            Check.That(() => count == SomeRows.Length);
        }
        public void should_be_SqlBulkCopy_compatible() {
            WithConnection(db => {
                var bulkCopy = SqlBulkCopyForRows(db);

                var data = new CollectionDataReader<Row>(SomeRows);
                data.ColumnMappings
                    .Add(x => x.Id)
                    .Add(x => x.Value);

                bulkCopy.WriteToServer(data);
                CheckRows(db, SomeRows);
            });
        }
 public void MapAll() 
 {
     DataReader = new[] { new TypeWithFieldsAndProperties { SomeField = 1, SomeProperty = 2} }.AsDataReader();
     DataReader.MapAll();
     DataReader.Read();
 }