We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents de33b32 + 6d11d8f commit 2464471Copy full SHA for 2464471
Roadmap/13 - PRUEBAS UNITARIAS/java/chartypes.java
@@ -0,0 +1,25 @@
1
+import static org.junit.Assert.assertEquals;
2
+import org.junit.Test;
3
+
4
+public class chartypes {
5
6
+ public static void main(String[] args) {
7
+ Tests.addSumCorrectly();
8
+ }
9
10
+ // Exercise
11
+ public static int add(int x, int y) {
12
+ return x + y;
13
14
+}
15
16
+class Tests {
17
+ @Test
18
+ static void addSumCorrectly() {
19
+ assertEquals(4, chartypes.add(2, 2));
20
+ assertEquals(5, chartypes.add(3, 2));
21
+ assertEquals(0, chartypes.add(0, 0));
22
+ assertEquals(100, chartypes.add(99, 1));
23
+ assertEquals(1, chartypes.add(0, 1));
24
25
0 commit comments