forked from alxsoares/topcoder-6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoxLoaderTest.java
More file actions
89 lines (70 loc) · 1.65 KB
/
Copy pathBoxLoaderTest.java
File metadata and controls
89 lines (70 loc) · 1.65 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
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class BoxLoaderTest {
protected BoxLoader solution;
@Before
public void setUp() {
solution = new BoxLoader();
}
@Test(timeout = 2000)
public void testCase0() {
int boxX = 100;
int boxY = 98;
int boxZ = 81;
int itemX = 3;
int itemY = 5;
int itemZ = 7;
int expected = 7560;
int actual = solution.mostItems(boxX, boxY, boxZ, itemX, itemY, itemZ);
Assert.assertEquals(expected, actual);
}
@Test(timeout = 2000)
public void testCase1() {
int boxX = 10;
int boxY = 10;
int boxZ = 10;
int itemX = 9;
int itemY = 9;
int itemZ = 11;
int expected = 0;
int actual = solution.mostItems(boxX, boxY, boxZ, itemX, itemY, itemZ);
Assert.assertEquals(expected, actual);
}
@Test(timeout = 2000)
public void testCase2() {
int boxX = 201;
int boxY = 101;
int boxZ = 301;
int itemX = 100;
int itemY = 30;
int itemZ = 20;
int expected = 100;
int actual = solution.mostItems(boxX, boxY, boxZ, itemX, itemY, itemZ);
Assert.assertEquals(expected, actual);
}
@Test(timeout = 2000)
public void testCase3() {
int boxX = 913;
int boxY = 687;
int boxZ = 783;
int itemX = 109;
int itemY = 93;
int itemZ = 53;
int expected = 833;
int actual = solution.mostItems(boxX, boxY, boxZ, itemX, itemY, itemZ);
Assert.assertEquals(expected, actual);
}
@Test(timeout = 2000)
public void testCase4() {
int boxX = 6;
int boxY = 5;
int boxZ = 4;
int itemX = 3;
int itemY = 2;
int itemZ = 1;
int expected = 20;
int actual = solution.mostItems(boxX, boxY, boxZ, itemX, itemY, itemZ);
Assert.assertEquals(expected, actual);
}
}