Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DataGenerator unit test. #4848

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package hmda.publisher.helper

import org.scalatest.{Matchers, WordSpec}
import scala.util.matching.Regex


class DateGeneratorSpec extends WordSpec with Matchers {

val generator = DateGenerator


"date generator" should {

"return a correctly formatted annual date string" in {
val annualPattern: Regex = raw"\d{4}-\d{2}-\d{2}-".r
val annualMatch = annualPattern.findFirstIn(generator.currentDate)
assert(annualMatch.contains(generator.currentDate))
}

"return a correctly formatted quarterly date string" in {
val quarterPattern: Regex = raw"\d{4}-\d{2}-\d{2}_".r
val quarterMatch = quarterPattern.findFirstIn(generator.currentQuarterlyDate)
assert(quarterMatch.contains(generator.currentQuarterlyDate))
}
}

}
Loading