-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed a bug that thrown exception with certain numbers
- Loading branch information
Showing
4 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Persian_Numbers/src/test/java/com/github/yamin8000/ppn/MehdiTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.github.yamin8000.ppn | ||
|
||
import com.github.yamin8000.ppn.PersianHelpers.spellToPersian | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
|
||
class MehdiTests { | ||
|
||
@Test | ||
fun firstMehdiTests() { | ||
assertEquals("یکصد و یک", 101.spellToPersian()) | ||
} | ||
|
||
@Test | ||
fun otherMehdiTests() { | ||
assertEquals("دویست و دو", 202.spellToPersian()) | ||
assertEquals("یک هزار و یکصد و یک", 1101.spellToPersian()) | ||
assertEquals("نود و نه هزار و نهصد و نه", 99_909.spellToPersian()) | ||
assertEquals("پانصد و پنجاه و پنج هزار و پانصد و پنج", 555_505.spellToPersian()) | ||
assertEquals("یک هزار و پنج", 1005.spellToPersian()) | ||
assertEquals("یک هزار و پانصد و پنج", 1505.spellToPersian()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters