-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVectorHeap2Test.java
More file actions
65 lines (55 loc) · 1.45 KB
/
VectorHeap2Test.java
File metadata and controls
65 lines (55 loc) · 1.45 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
import static org.junit.Assert.*;
import org.junit.Test;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Assert.*;
import java.util.Vector;
import junit.framework.TestCase;
// TODO: Auto-generated Javadoc
/**
* The Class VectorHeapTest.
*
* @author Admin
*/
public class VectorHeap2Test extends TestCase{
/**
* Instantiates a new vector heap test.
*/
public VectorHeap2Test(){
}
/** The heap. */
VectorHeap2<String> heap = new VectorHeap2();
/**
* Test add.
*/
@Test
public void testAdd(){
System.out.println("add");
String prioridad = "A";
heap.add(prioridad);
assertEquals(prioridad,heap.remove());
}
/**
* Test remove.
*/
@Test
public void testRemove(){
System.out.println("remove");
String prioridad1="A";
String prioridad2="B";
heap.add(prioridad1);
heap.add(prioridad2);
String Result = "B";
String result = heap.remove(); // "A"
result = heap.remove(); // "B"
assertEquals(Result, result); ///"B"="B"
}
}