-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaskukoneTest.java
More file actions
51 lines (42 loc) · 1.24 KB
/
Copy pathLaskukoneTest.java
File metadata and controls
51 lines (42 loc) · 1.24 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package laskukone;
import static org.junit.jupiter.api.Assertions.*;
class LaskukoneTest {
@org.junit.jupiter.api.Test
void lisaaLukuTest() {
Laskukone testi = new Laskukone();
testi.lisaaLuku(5);
assertEquals(5,testi.tulos);
}
@org.junit.jupiter.api.Test
void vahennaLukuTest() {
Laskukone testi = new Laskukone();
testi.vahennaLuku(5);
assertEquals(-5,testi.tulos);
}
@org.junit.jupiter.api.Test
void kerroLuvullaTest() {
Laskukone testi = new Laskukone();
testi.lisaaLuku(5);
testi.kerroLuvulla(2);
assertEquals(10,testi.tulos);
}
@org.junit.jupiter.api.Test
void korotaPotenssiinTest() {
Laskukone testi = new Laskukone();
testi.lisaaLuku(5);
testi.korotaPotenssiin(2);
assertEquals(25,testi.tulos);
}
@org.junit.jupiter.api.Test
void annaTulosTest() {
Laskukone testi = new Laskukone();
testi.lisaaLuku(8);
assertEquals(8,testi.tulos);
}
@org.junit.jupiter.api.Test
void nollaaTest() {
Laskukone testi = new Laskukone();
testi.nollaa();
assertEquals(0,testi.tulos);
}
}