-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathResultTest.java
More file actions
26 lines (20 loc) · 756 Bytes
/
ResultTest.java
File metadata and controls
26 lines (20 loc) · 756 Bytes
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
package hackrank.algorithm.implement.chocolate;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
public class ResultTest {
@Test
public void chocolateFeast_HackerRankSampleInput_ExpectedTotal() {
int totalEaten = Result.chocolateFeast(10, 2, 5);
assertThat(totalEaten).isEqualTo(6);
}
@Test
public void chocolateFeast_NotEnoughWrappersForExchange_ExpectedTotal() {
int totalEaten = Result.chocolateFeast(12, 3, 10);
assertThat(totalEaten).isEqualTo(4);
}
@Test
public void chocolateFeast_MultipleWrapperExchanges_ExpectedTotal() {
int totalEaten = Result.chocolateFeast(15, 3, 2);
assertThat(totalEaten).isEqualTo(9);
}
}