-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayTddTest
More file actions
77 lines (63 loc) · 1.6 KB
/
ArrayTddTest
File metadata and controls
77 lines (63 loc) · 1.6 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package prArrayAsociativo;
import static org.junit.Assert.*;
import org.junit.Test;
public class ArrayAsociativoTest {
@Test
public void test() {
ArrayAsociativo a = new ArrayAsociativo(10);
}
@Test
public void test2() {
ArrayAsociativo a = new ArrayAsociativo<Integer,Integer>(10);
a.put(3,4);
}
@Test
public void test3() {
ArrayAsociativo<Integer, Integer> a = new ArrayAsociativo<Integer,Integer>(10);
a.put(3,4);
int res = (int) a.get(3);
assertEquals(4, res);
}
@Test (expected = ArrayException.class)
public void test4() {
ArrayAsociativo<Integer, Integer> a = new ArrayAsociativo<Integer,Integer>(10);
for(int i =0;i<11;i++){
a.put(3,4);
}
}
@Test
public void test5() {
ArrayAsociativo<Integer, Integer> a = new ArrayAsociativo<Integer,Integer>(10);
boolean res = a.isempty();
assertTrue(res);
}
@Test
public void test6() {
ArrayAsociativo<Integer, Integer> a = new ArrayAsociativo<Integer,Integer>(10);
a.put(3, 4);
a.remove(3);
boolean res = a.isempty();
;
assertTrue(res);
}
@Test (expected = ArrayException.class)
public void test7() {
ArrayAsociativo<Integer, Integer> a = new ArrayAsociativo<Integer,Integer>(10);
a.remove(3);
}
@Test (expected = ArrayException.class)
public void test8() {
ArrayAsociativo<Integer, Integer> a = new ArrayAsociativo<Integer,Integer>(10);
a.put(3, 4);
a.put(3, 5);
}
@Test
public void test9() {
ArrayAsociativo<Integer, Integer> a = new ArrayAsociativo<Integer,Integer>(10);
a.put(3, 4);
a.remove(3);
a.put(3, 5);
int res = a.get(3);
assertEquals(5, res);
}
}