-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
7361c60
commit bc73837
Showing
3 changed files
with
87 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 21 additions & 19 deletions
40
src/test/java/fr/ifpen/allotropeconverters/gc/chemstation/ColumnInformationMapperTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
package fr.ifpen.allotropeconverters.gc.chemstation; | ||
|
||
import fr.ifpen.allotropeconverters.gc.chemstation.ColumnInformationMapper; | ||
import java.io.IOException; | ||
|
||
import fr.ifpen.allotropeconverters.gc.schema.ChromatographyColumnDocument; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.File; | ||
import java.net.URI; | ||
import java.nio.file.Paths; | ||
|
||
class ColumnInformationMapperTests { | ||
|
||
@Test | ||
void MapperCI() throws Exception { | ||
URI uri; | ||
uri = new File("src/test/resources/V179.D").toURI(); | ||
void mapperCI() throws IOException { | ||
readAndAssertColumnInformation("src/test/resources/V179.D"); | ||
} | ||
|
||
ColumnInformationMapper columnInformationMapper = new ColumnInformationMapper(); | ||
@Test | ||
void mapperCI_withMultipleColumnInformationPerLine() throws IOException { | ||
readAndAssertColumnInformation("src/test/resources/V179_2.D"); | ||
} | ||
|
||
ChromatographyColumnDocument chromatographyColumnDocument = columnInformationMapper.readColumnDocumentFromFile( | ||
Paths.get(uri).toString()); | ||
private static void readAndAssertColumnInformation(String folderPath) throws IOException { | ||
ColumnInformationMapper columnInformationMapper = new ColumnInformationMapper(); | ||
|
||
Assertions.assertEquals("19091S-001", chromatographyColumnDocument.getChromatographyColumnPartNumber()); | ||
Assertions.assertEquals("Agilent",chromatographyColumnDocument.getProductManufacturer()); | ||
Assertions.assertEquals(0.2,chromatographyColumnDocument.getColumnInnerDiameter().getValue()); | ||
Assertions.assertEquals("mm",chromatographyColumnDocument.getColumnInnerDiameter().getUnit()); | ||
Assertions.assertEquals(50,chromatographyColumnDocument.getChromatographyColumnLength().getValue()); | ||
Assertions.assertEquals("m",chromatographyColumnDocument.getChromatographyColumnLength().getUnit()); | ||
Assertions.assertEquals(0.50,chromatographyColumnDocument.getChromatographyColumnFilmThickness().getValue()); | ||
Assertions.assertEquals("µm",chromatographyColumnDocument.getChromatographyColumnFilmThickness().getUnit()); | ||
ChromatographyColumnDocument chromatographyColumnDocument = columnInformationMapper.readColumnDocumentFromFile( | ||
folderPath); | ||
|
||
Assertions.assertEquals("19091S-001", chromatographyColumnDocument.getChromatographyColumnPartNumber()); | ||
Assertions.assertEquals("Agilent", chromatographyColumnDocument.getProductManufacturer()); | ||
Assertions.assertEquals(0.2, chromatographyColumnDocument.getColumnInnerDiameter().getValue()); | ||
Assertions.assertEquals("mm", chromatographyColumnDocument.getColumnInnerDiameter().getUnit()); | ||
Assertions.assertEquals(50, chromatographyColumnDocument.getChromatographyColumnLength().getValue()); | ||
Assertions.assertEquals("m", chromatographyColumnDocument.getChromatographyColumnLength().getUnit()); | ||
Assertions.assertEquals(0.50, chromatographyColumnDocument.getChromatographyColumnFilmThickness().getValue()); | ||
Assertions.assertEquals("µm", chromatographyColumnDocument.getChromatographyColumnFilmThickness().getUnit()); | ||
} | ||
} |
Binary file not shown.