forked from TheAlgorithms/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubsetCountTest.java
More file actions
29 lines (25 loc) · 768 Bytes
/
SubsetCountTest.java
File metadata and controls
29 lines (25 loc) · 768 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
package com.thealgorithms.dynamicprogramming;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
public class SubsetCountTest {
@Test
void hasMultipleSubset() {
int[] arr = new int[] {1, 2, 3, 3};
assertEquals(3, SubsetCount.getCount(arr, 6));
}
@Test
void singleElementSubset() {
int[] arr = new int[] {1, 1, 1, 1};
assertEquals(4, SubsetCount.getCount(arr, 1));
}
@Test
void hasMultipleSubsetSO() {
int[] arr = new int[] {1, 2, 3, 3};
assertEquals(3, SubsetCount.getCountSO(arr, 6));
}
@Test
void singleSubsetSO() {
int[] arr = new int[] {1, 1, 1, 1};
assertEquals(1, SubsetCount.getCountSO(arr, 4));
}
}