Skip to content
Snippets Groups Projects
Commit 43a4f83a authored by Christopher Schankula's avatar Christopher Schankula :earth_africa:
Browse files

several comments

parent 92beb168
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,11 @@ import org.junit.*;
import graph.CC;
import graph.Graph;
/**
* Tests for connected components.
* @author TrawlStars, Inc.
*
*/
public class CCTest {
@Before
......@@ -67,4 +72,35 @@ public class CCTest {
CC cc1 = new CC(g);
assertEquals(cc1.count(), 3);//3 sets of clusters
}
@Test
public void testConnected2() {
Graph g = new Graph(7);
g.addEdge(4, 3);
g.addEdge(2, 3);
g.addEdge(1, 2);
g.addEdge(0, 2);
g.addEdge(5, 6);
CC component = new CC(g);
assert(component.connected(2, 0)); //true
assert(component.connected(0,1)); //true
assert(!component.connected(1, 5)); //false
}
@Test
public void testComponentId2() {
Graph g = new Graph(7);
g.addEdge(4, 3);
g.addEdge(2, 3);
g.addEdge(1, 2);
g.addEdge(0, 2);
g.addEdge(5, 6);
CC component = new CC(g);
assert(component.id(0) == 0);
assert(component.id(5) == 1);
assert(component.id(6) == 1);
}
}
......@@ -13,6 +13,7 @@ import sort.GeneralCompare;
import sort.MergeSort;
/**
* Test mergesort.
* @author HaleyGlavina
*
*/
......
......@@ -11,6 +11,7 @@ import sort.GeneralCompare;
import sort.QuickSelect;
/**
* Test quickselect.
* @author HaleyGlavina
*
*/
......
......@@ -3,8 +3,6 @@
*/
package test;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
......@@ -15,6 +13,7 @@ import search.RedBlackTree;
import sort.GeneralCompare;
/**
* Test red-black tree.
* @author HaleyGlavina
*
*/
......
......@@ -8,6 +8,11 @@ import org.junit.Test;
import graph.CC;
import graph.Graph;
/**
* Tests for connected components.
* @author TrawlStars, Inc.
*
*/
public class TestConnectedComponents {
Graph g;
CC component;
......@@ -23,18 +28,5 @@ public class TestConnectedComponents {
component = new CC(g);
}
@Test
public void testConnected() {
assert(component.connected(2, 0)); //true
assert(component.connected(0,1)); //true
assert(!component.connected(1, 5)); //false
}
@Test
public void testComponentId() {
assert(component.id(0) == 0);
assert(component.id(5) == 1);
assert(component.id(6) == 1);
}
}
......@@ -5,6 +5,11 @@ import org.junit.*;
import graph.Graph;
/**
* Test cases for the Graph class.
* @author TrawlStars, Inc.
*
*/
public class TestGraph {
@Before
......
......@@ -10,6 +10,11 @@ import search.kdt.KDT;
import sort.GeneralCompare;
import sort.GeneralRange;
/**
* Testing the kd-tree with 2-d data.
* @author TrawlStars, Inc.
*
*/
public class TestKDTree {
private static KDT<Point> kdt;
......
......@@ -12,6 +12,11 @@ import data.WormsAPI;
import data.biotree.TaxonNode;
import data.biotree.TaxonType;
/**
* Test cases for the World Register of Marine Species (WORMS) database API module.
* @author macoutreachadmin
*
*/
public class TestWORMS {
@Before
public void setUp() throws Exception {
......
/**
* Implements several unittests for the various modules in the project, using the JUnit 4
* unittesting library.
* @author TrawlStars, Inc.
*
*/
package test;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment