-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathResultTest.java
More file actions
32 lines (25 loc) · 928 Bytes
/
ResultTest.java
File metadata and controls
32 lines (25 loc) · 928 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
27
28
29
30
31
32
package hackrank.algorithm.implement.fine;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
public class ResultTest {
@Test
public void libraryFine_ReturnedBeforeDue_NoFine() {
int fine = Result.libraryFine(27, 9, 2021, 1, 10, 2021);
assertThat(fine).isEqualTo(0);
}
@Test
public void libraryFine_ReturnedLateDifferentYear_MaxFine() {
int fine = Result.libraryFine(17, 4, 2022, 1, 10, 2021);
assertThat(fine).isEqualTo(10000);
}
@Test
public void libraryFine_ReturnedLateDifferentMonth_FinePerMonthLate() {
int fine = Result.libraryFine(17, 8, 2021, 1, 4, 2021);
assertThat(fine).isEqualTo(2000);
}
@Test
public void libraryFine_ReturnedLateSameMonth_FinePerDayLate() {
int fine = Result.libraryFine(11, 10, 2021, 1, 10, 2021);
assertThat(fine).isEqualTo(150);
}
}