forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_458Test.java
58 lines (50 loc) · 1.33 KB
/
_458Test.java
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
package com.fishercoder;
import com.fishercoder.solutions._458;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
public class _458Test {
private static _458 test;
private static int expected;
private static int actual;
private static int buckets;
private static int minutesToDie;
private static int minutesToTest;
@BeforeClass
public static void setup(){
test = new _458();
}
@Before
public void setupForEachTest(){
expected = 0;
actual = 0;
}
@Test
public void test1(){
buckets = 1000;
minutesToDie = 15;
minutesToTest = 60;
expected = 5;
actual = test.poorPigs(buckets, minutesToDie, minutesToTest);
assertEquals(expected, actual);
}
@Test
public void test2(){
buckets = 1;
minutesToDie = 1;
minutesToTest = 1;
expected = 0;
actual = test.poorPigs(buckets, minutesToDie, minutesToTest);
assertEquals(expected, actual);
}
@Test
public void test3(){
buckets = 1000;
minutesToDie = 12;
minutesToTest = 60;
expected = 4;
actual = test.poorPigs(buckets, minutesToDie, minutesToTest);
assertEquals(expected, actual);
}
}