Skip to content

Commit ff8380a

Browse files
author
Hai Nguyen
committed
add random string test
1 parent cb1b3d5 commit ff8380a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
import org.junit.jupiter.api.Test
3+
import java.util.concurrent.ThreadLocalRandom
4+
import kotlin.test.assertTrue
5+
6+
class RandomNumberTest {
7+
8+
@Test
9+
fun whenRandomNumberWithJavaUtilMath_thenResultIsBetween0And1() {
10+
val source = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
11+
var test = Random().ints(outputStrLength, 0, source.length)
12+
.asSequence()
13+
.map(source::get)
14+
.joinToString("")
15+
print("message")
16+
}
17+
18+
}

0 commit comments

Comments
 (0)