Skip to content

Commit

Permalink
#23 Parse RecSensor csv file
Browse files Browse the repository at this point in the history
  • Loading branch information
baardl committed Apr 17, 2023
1 parent a146680 commit 9356494
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package no.cantara.realestate.mappingtable.rec;

import no.cantara.realestate.mappingtable.csv.CsvCollection;
import no.cantara.realestate.mappingtable.csv.CsvReader;
import org.junit.jupiter.api.Test;

import java.util.Map;

import static org.junit.jupiter.api.Assertions.*;

public class ReadSensorRecCsvTest {

@Test
void readBasic() {
CsvCollection collection = CsvReader.parse("src/test/resources/RecSensor.csv");
assertNotNull(collection);
assertTrue(collection.getColumnNames().contains("RecId"));
assertTrue(collection.getColumnNames().contains("RealEstate"));
assertTrue(collection.getColumnNames().contains("Section"));
Map record = collection.getRecords().get(0);
assertEquals("aaa-bbb-ccc", record.get("RecId"));
assertEquals("re16", record.get("RealEstate"));
assertEquals("",record.get("Section"));
}
}
2 changes: 2 additions & 0 deletions src/test/resources/RecSensor.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RecId,RealEstate,Building,Floor,Section,ServesRoom,PlacementRoom,ClimateZone,ElectricityZone,SensorType,MeasurementUnit,Name,Description
aaa-bbb-ccc,re16,1,02,,101,101,1,,co2,ppm,TFM-RY02101,CO2 rom 101

0 comments on commit 9356494

Please sign in to comment.