-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
13 changed files
with
243 additions
and
101 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
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
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
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
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
46 changes: 46 additions & 0 deletions
46
src/test/java/com/poiji/deserialize/RawValueFormulaTest.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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.poiji.deserialize; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
|
||
import com.poiji.bind.Poiji; | ||
import com.poiji.deserialize.model.RowModelFormula; | ||
import com.poiji.option.PoijiOptions; | ||
import java.io.File; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
/** | ||
* Created by jmorgan on 12.09.2023 | ||
*/ | ||
@RunWith(Parameterized.class) | ||
public class RawValueFormulaTest { | ||
|
||
private String path; | ||
|
||
public RawValueFormulaTest(String path) { | ||
this.path = path; | ||
} | ||
|
||
@Parameterized.Parameters(name = "{index}: ({0})={1}") | ||
public static Iterable<Object[]> queries() { | ||
return Arrays.asList(new Object[][] { | ||
{ "src/test/resources/raw_value_formula.xls" }, | ||
{ "src/test/resources/raw_value_formula.xlsx" }, | ||
}); | ||
} | ||
|
||
@Test | ||
public void shouldMapCalculations() { | ||
PoijiOptions options = PoijiOptions.PoijiOptionsBuilder.settings().headerCount(0).rawData(true).build(); | ||
List<RowModelFormula> models = Poiji.fromExcel(new File(path), RowModelFormula.class, options); | ||
|
||
for (RowModelFormula model : models) { | ||
assertThat(model.getCurrencyValue(), is(123.45D)); | ||
assertThat(model.getFormulaValue(), is(246.90D)); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.