File tree Expand file tree Collapse file tree
main/kotlin/fmt/kotlin/fundamentals
test/kotlin/fmt/kotlin/fundamentals Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ plugins {
2+ id(" fmt.kotlin.fundamentals.gradle.component.tp" )
3+ }
Original file line number Diff line number Diff line change 1+ package fmt.kotlin.fundamentals
2+
3+ class Tp2 {
4+
5+ fun getFirstPrimeNumbers (nbToFind : Int ): List <Int > {
6+ return arrayListOf<Int >()
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ package fmt.kotlin.fundamentals
2+
3+ import org.junit.jupiter.api.Assertions.*
4+ import org.junit.jupiter.api.Nested
5+ import org.junit.jupiter.api.Test
6+ import strikt.api.expectThat
7+ import strikt.assertions.isEqualTo
8+
9+ class Tp2Test {
10+
11+ private val tp2 = Tp2 ()
12+
13+ @Nested
14+ inner class Prime {
15+
16+ @Test
17+ fun `should return 100 first prime numbers` () {
18+ val numbers = tp2.getFirstPrimeNumbers(100 )
19+
20+ expectThat(numbers).isEqualTo(
21+ listOf (
22+ 2 ,
23+ 3 ,
24+ 5 ,
25+ 7 ,
26+ 11 ,
27+ 13 ,
28+ 17 ,
29+ 19 ,
30+ 23 ,
31+ 29 ,
32+ 31 ,
33+ 37 ,
34+ 41 ,
35+ 43 ,
36+ 47 ,
37+ 53 ,
38+ 59 ,
39+ 61 ,
40+ 67 ,
41+ 71 ,
42+ 73 ,
43+ 79 ,
44+ 83 ,
45+ 89 ,
46+ 97 ,
47+ 101 ,
48+ 103 ,
49+ 107 ,
50+ 109 ,
51+ 113 ,
52+ 127 ,
53+ 131 ,
54+ 137 ,
55+ 139 ,
56+ 149 ,
57+ 151 ,
58+ 157 ,
59+ 163 ,
60+ 167 ,
61+ 173 ,
62+ 179 ,
63+ 181 ,
64+ 191 ,
65+ 193 ,
66+ 197 ,
67+ 199 ,
68+ 211 ,
69+ 223 ,
70+ 227 ,
71+ 229 ,
72+ 233 ,
73+ 239 ,
74+ 241 ,
75+ 251 ,
76+ 257 ,
77+ 263 ,
78+ 269 ,
79+ 271 ,
80+ 277 ,
81+ 281 ,
82+ 283 ,
83+ 293 ,
84+ 307 ,
85+ 311 ,
86+ 313 ,
87+ 317 ,
88+ 331 ,
89+ 337 ,
90+ 347 ,
91+ 349 ,
92+ 353 ,
93+ 359 ,
94+ 367 ,
95+ 373 ,
96+ 379 ,
97+ 383 ,
98+ 389 ,
99+ 397 ,
100+ 401 ,
101+ 409 ,
102+ 419 ,
103+ 421 ,
104+ 431 ,
105+ 433 ,
106+ 439 ,
107+ 443 ,
108+ 449 ,
109+ 457 ,
110+ 461 ,
111+ 463 ,
112+ 467 ,
113+ 479 ,
114+ 487 ,
115+ 491 ,
116+ 499 ,
117+ 503 ,
118+ 509 ,
119+ 521 ,
120+ 523 ,
121+ 541
122+ )
123+ )
124+ }
125+ }
126+
127+ }
You can’t perform that action at this time.
0 commit comments