Skip to content

Commit

Permalink
Fix DataGenerator unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredb96 committed Jul 11, 2024
1 parent 9f0d0eb commit 9cbc796
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package hmda.publisher.helper

import org.scalatest.{Matchers, WordSpec}
import java.time.LocalDate
import java.time.format.DateTimeFormatter


class DateGeneratorSpec extends WordSpec with Matchers {

val generator = DateGenerator
val currentDate: LocalDate = LocalDate.now().minusDays(1)
val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
val actualDateString: String = currentDate.format(formatter) + "-"
val actualQuarterlyDateString: String = currentDate.format(formatter) + "_"

"date generator" should {

"return correct current date" in {
assert(generator.currentDate == actualDateString)
}

"return correct current quarterly date" in {
assert(generator.currentQuarterlyDate == actualQuarterlyDateString)
}
}

}

0 comments on commit 9cbc796

Please sign in to comment.