Skip to content

Commit

Permalink
fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
axtstar committed Jul 9, 2018
1 parent b9365ef commit 5b3c9bc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
publishMavenStyle := true

name := "asta4e"
version := "0.0.3-SNAPSHOT"
version := "0.0.3"

scalaVersion := "2.11.12"
crossScalaVersions := Seq("2.11.12", "2.12.6")
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/excel/.~lock.bind_template4.xlsx#

This file was deleted.

13 changes: 13 additions & 0 deletions src/test/scala/com/axtstar/asta4e/utils/Etc7.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.axtstar.asta4e.utils

import java.util.Date

case class Etc7(
numeric: Double,
string:String,
date:Date,
formula:String,
bool:Boolean,
time:Date,
userDate:Date
)
26 changes: 26 additions & 0 deletions src/test/scala/com/axtstar/asta4e/utils/HelperTest.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.axtstar.asta4e.utils

import java.io.File
import java.text.SimpleDateFormat

import com.axtstar.asta4e.ExcelMapper
import org.junit.runner.RunWith
Expand Down Expand Up @@ -142,6 +143,31 @@ class HelperTest extends Specification {

}

"Etc" in {
val target = ExcelMapper.getData(
s"${currentDir}/src/test/resources/excel/bind_template4.xlsx",
s"${currentDir}/src/test/resources/excel/read_sample4.xlsx",
List("設定")
)

val result = Helper.to[Etc7].from(target.head._2)

val dateFormat = new SimpleDateFormat("yyyy/MM/dd")
val timeFormat = new SimpleDateFormat("HH:mm:ss")

val dateFormatFull = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss")

result.get.numeric must be_==(111)
result.get.string must be_==("111")

result.get.date must be_==(dateFormat.parse("1970/01/01"))
result.get.formula must be_==("111")
result.get.bool must be_==(true)
result.get.time must be_==(dateFormatFull.parse("1899/12/31 17:25:47"))
result.get.userDate must be_==(dateFormatFull.parse("2018/7/2 22:35:54"))

}


}
}

0 comments on commit 5b3c9bc

Please sign in to comment.