-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathModulusTenTests.kt
More file actions
31 lines (25 loc) · 953 Bytes
/
ModulusTenTests.kt
File metadata and controls
31 lines (25 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import com.github.pauldambra.moduluschecker.ModulusAlgorithm
import com.github.pauldambra.moduluschecker.ModulusCheckParams
import com.github.pauldambra.moduluschecker.account.BankAccount
import com.github.pauldambra.moduluschecker.chain.checks.ModulusTenCheck
import com.github.pauldambra.moduluschecker.valacdosFile.WeightRow
import com.natpryce.hamkrest.assertion.assert
import com.natpryce.hamkrest.equalTo
import org.junit.Test
class ModulusTenTests {
@Test
fun canRunModulusTenCheck() {
val sc = "089999"
val an = "66374958"
val row = WeightRow(
ModulusAlgorithm.MOD10,
listOf(0, 0, 0, 0, 0, 0, 7, 1, 3, 7, 1, 3, 7, 1),
null
)
val params = ModulusCheckParams(
BankAccount(sc, an), row)
val checker = ModulusTenCheck()
val result = checker.check(params.account, params.firstWeightRow!!)
assert.that(result, equalTo(true))
}
}