Added another invalid map test case to DFS tests.
This commit is contained in:
parent
81fb18ab3d
commit
78cd32106f
@ -52,6 +52,13 @@ public class DepthFirstSearchTest extends TestCase
|
|||||||
{true, false, false, false},
|
{true, false, false, false},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private boolean[][] mapE = new boolean[][] {
|
||||||
|
{true, true, true, true},
|
||||||
|
{false, false, false, false},
|
||||||
|
{true, true, true, true},
|
||||||
|
{true, false, false, false},
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the test case
|
* Create the test case
|
||||||
*
|
*
|
||||||
@ -88,16 +95,25 @@ public class DepthFirstSearchTest extends TestCase
|
|||||||
dfs.Setup(3, 2, 3, 0);
|
dfs.Setup(3, 2, 3, 0);
|
||||||
assertTrue(dfs.buildTree());
|
assertTrue(dfs.buildTree());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDFSMapDValid()
|
public void testDFSMapDValid()
|
||||||
{
|
{
|
||||||
DepthFirstSearch dfs = new DepthFirstSearch(new Validator(mapD));
|
DepthFirstSearch dfs = new DepthFirstSearch(new Validator(mapD));
|
||||||
dfs.Setup(0, 3, 0, 0);
|
dfs.Setup(0, 3, 0, 0);
|
||||||
assertTrue(dfs.buildTree());
|
assertTrue(dfs.buildTree());
|
||||||
}
|
}
|
||||||
public void testDFSInvalid()
|
|
||||||
|
public void testDFSMapCInvalid()
|
||||||
{
|
{
|
||||||
DepthFirstSearch dfs = new DepthFirstSearch(new Validator(mapC));
|
DepthFirstSearch dfs = new DepthFirstSearch(new Validator(mapC));
|
||||||
dfs.Setup(3, 2, 3, 0);
|
dfs.Setup(3, 2, 3, 0);
|
||||||
assertFalse(dfs.buildTree());
|
assertFalse(dfs.buildTree());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testDFSMapEInvalid()
|
||||||
|
{
|
||||||
|
DepthFirstSearch dfs = new DepthFirstSearch(new Validator(mapE));
|
||||||
|
dfs.Setup(3, 2, 3, 0);
|
||||||
|
assertFalse(dfs.buildTree());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user