Permalink
Browse files

add test

  • Loading branch information...
axtstar committed Jul 31, 2018
1 parent 86c58dc commit 8807466e0ec0b5782836a5fc880afdeb3e636c50
@@ -29,7 +29,7 @@ add dependency like the below
```sbt
libraryDependencies ++= Seq(
"com.axtstar" %% "asta4e" % "0.0.4"
"com.axtstar" %% "asta4e" % "0.0.6"
)
```
@@ -142,6 +142,27 @@ class ExcelMapperTest extends Specification {
result.head._2.head.numeric.get must be_==(111.0D)
result.head._2.head.string.get must be_==("111")
val result2 = ExcelMapper.by[Etc6].getDataAsAny(
s"${currentDir}/src/test/resources/excel/bind_template4.xlsx",
s"${currentDir}/src/test/resources/excel/read_sample4.xlsx",
List()
)
result2.size must be_==(1)
result2.head._2.head.bool must be_==(true)
result2.head._2.head.string must be_==("111")
val result3 = ExcelMapper.by[Etc8].getDataAsAny(
s"${currentDir}/src/test/resources/excel/bind_template4.xlsx",
s"${currentDir}/src/test/resources/excel/read_sample4.xlsx",
List()
)
result3.size must be_==(1)
result3.head._2 must be_==(None)
}
"setDataAsTemplate to getDataAsTemplate" in {
@@ -0,0 +1,12 @@
package com.axtstar.asta4e.test_class
import java.util.Date
case class Etc6(
string:String,
date:Date,
formula:String,
bool:Boolean,
time:Date,
userDate:Date
)
@@ -10,4 +10,9 @@ case class Etc7(
bool:Boolean,
time:Date,
userDate:Date
)
){
val result : Boolean = false
def getResult = {
result
}
}
@@ -0,0 +1,14 @@
package com.axtstar.asta4e.test_class
import java.util.Date
case class Etc8(
extra:String,
numeric: Double,
string:String,
date:Date,
formula:String,
bool:Boolean,
time:Date,
userDate:Date
)

0 comments on commit 8807466

Please sign in to comment.