Skip to content

Commit

Permalink
test: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kabirnayeem99 committed Jul 26, 2024
1 parent a64cf7f commit b8f64db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.github.kabirnayeem99.viminfo.entities
import io.github.kabirnayeem99.viminfo.data.manufacturers
import io.github.kabirnayeem99.viminfo.data.years
import io.github.kabirnayeem99.viminfo.exceptions.InvalidVinLengthException
import io.github.kabirnayeem99.viminfo.exceptions.InvalidVinRegionChar
import io.github.kabirnayeem99.viminfo.exceptions.InvalidVinRegionCharException
import io.github.kabirnayeem99.viminfo.exceptions.InvalidVinYearException

data class Vin(
Expand Down Expand Up @@ -46,7 +46,7 @@ data class Vin(
regexNA.containsMatchIn(regionId) -> "NA"
regexOC.containsMatchIn(regionId) -> "OC"
regexSA.containsMatchIn(regionId) -> "SA"
else -> throw InvalidVinRegionChar(regionId)
else -> throw InvalidVinRegionCharException(regionId)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.kabirnayeem99.viminfo.exceptions

class InvalidVinRegionChar(regionChar: String) :
class InvalidVinRegionCharException(regionChar: String) :
Exception("Invalid region ID: '$regionChar'. The first character of the VIN should be within the ranges A-H, J-R, S-Z, or 1-9 to indicate a valid region. Please check the VIN and try again.")
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,8 @@ class VinInfoTest {
}
}

@Test
fun `VIN region should throw InvalidVinRegionCharException`() {
}

}

0 comments on commit b8f64db

Please sign in to comment.