@Test
public void testReadNextDBFRecord() throws Exception {

	try {
		this.reader.readNextDBFRecord();
		fail("MustCallReadHeaderFunctionException is expected"); //$NON-NLS-1$
	}
	catch(MustCallReadHeaderFunctionException exception) {
		// Expected exception
	}
	
	this.reader.readDBFHeader();
	this.reader.readDBFFields();
	
	int offset = 161; // header length
	
	DBaseFileRecord record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(0, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals(BATIMENT_RELIGIEUX_VALUE, record.getFieldValue(2));
	assertEquals(15., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(1, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals(BATIMENT_RELIGIEUX_VALUE, record.getFieldValue(2));
	assertEquals(7., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(2, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals(BATIMENT_RELIGIEUX_VALUE, record.getFieldValue(2));
	assertEquals(11., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(3, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(5., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(4, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(23., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(5, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(6., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(6, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(6., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(7, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(7., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(8, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(5., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(9, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(2., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(10, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(14., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(11, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(27., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(12, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(8., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(13, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(14., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(14, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(11., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(15, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(30., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(16, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(23., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(17, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(PHOTOGRAMMETRIE_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(35., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(18, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(BDTOPO_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(18., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(19, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(PHOTOGRAMMETRIE_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(15., record.getFieldValue(3));
	record = this.reader.readNextDBFRecord();
	assertNotNull(record);
	assertEquals(20, record.getRecordIndex());
	assertEquals(offset, record.getRecordOffset());
	offset += 94; // record length
	assertEquals(PHOTOGRAMMETRIE_VALUE, record.getFieldValue(0));
	assertEquals("Religieux", record.getFieldValue(1)); //$NON-NLS-1$
	assertEquals("Eglise", record.getFieldValue(2)); //$NON-NLS-1$
	assertEquals(11., record.getFieldValue(3));
	assertNull(this.reader.readNextDBFRecord());
}