Repository navigation
Expand file tree
/
Copy pathOneWayGridNavigatorTest.java
More file actions
90 lines (73 loc) · 1.92 KB
/
Copy pathOneWayGridNavigatorTest.java
File metadata and controls
90 lines (73 loc) · 1.92 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
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* Test class for one way grid problem
*/
package miscproblems;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Adarsh V
*/
public class OneWayGridNavigatorTest {
public OneWayGridNavigatorTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test with 0 input, of class OneWayGridNavigator.
*/
@Test
public void testWithBoth0() {
int expected = 0;
int length = 0;
int height = 0;
assertEquals(expected,OneWayGridNavigator.findPaths(length, height));
}
/**
* Test input with either length or heigh as 0
*/
@Test
public void testWithOneSide0() {
int expected = 0;
int length = 0;
int height = 1;
assertEquals(expected,OneWayGridNavigator.findPaths(length, height));
length = 10;
height = 0;
assertEquals(expected,OneWayGridNavigator.findPaths(length, height));
}
/**
* Test input with either length and height as 1
*/
@Test
public void testWithLength1() {
int expected = 2;
int length = 1;
int height = 1;
assertEquals(expected,OneWayGridNavigator.findPaths(length, height));
}
/**
* Test input with either length and height as 1
*/
@Test
public void testWithReasonableLength() {
int expected = 126;
int length = 4;
int height = 5;
assertEquals(expected,OneWayGridNavigator.findPaths(length, height));
}
}